/    Sign up×
Community /Pin to ProfileBookmark

Browser not finding files on localhost

Installed Apache 2 and PHP 4. I went and set everything up, and I created a file named test.php which basically has a echo statement saying “Hi!” I tried it and it worked. I figured I was good to go. I try today and when I use my text editor, I get pretty much a page with the PHP code showing on it. Since the text editor is pointing to my file through the C drive and not localhost, I figure I will go and look at it in my browser. I do this with using localhost as part of the URL and I now get a message saying the file can’t be found. I even use my drop down menu to locate my test file with the URL pointing to the localhost, and I still get nothing. Now, I know it’s there becasue it worked yesterday, and yes, the server is on. Any ideas?

EDIT: I can use the browser to find the files on my computer, but again, I get the PHP code showing when I try to display a PHP page.

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@PunkSktBrdr01Oct 30.2003 — Did you have the server running when you tried to use localhost?
Copy linkTweet thisAlerts:
@pyroOct 30.2003 — I would use Apache 1.3.28 for now, as support for Apache 2 is experimental:

[i]from PHP 4.3.3's install.txt[/i]

[b]------------------------------------------------------------

ATTENTION: Apache 2 Users



At this time, support for Apache 2 is experimental. It's

highly recommended you use PHP with Apache 1.3.x and not

Apache 2. Documentation for installing Apache 2 on windows

can be seen here:



http://www.php.net/manual/en/install.apache2.php

With the basic difference being that when installing as a

module you'll use php4apache2.dll instead of php4apache.dll

Both files are included within this release.

------------------------------------------------------------[/b][/quote]
Copy linkTweet thisAlerts:
@spufiauthorOct 30.2003 — Experimental is one thing, rolling dice and wondering what the result is going to be is much different. When I logged back on to my laptop, I went and tried it. This time I got the test page to work, but when I tried my mock order form it wasn't passing the data to the variables so it kept saying I didn't order anything. I already tested the form on my site because I was using that to test stuff out. Anyway, I'm not exactly excited about downloading v1.3 and then going back and setting up PHP with it, but at least I played around so much getting PHP working in the first place, it shouldn't be as bad this next time.
Copy linkTweet thisAlerts:
@pyroOct 30.2003 — Did you, by chance, use [URL=http://www.webdevfaqs.com/php.php#globalvariables]globalvariables[/URL]? PHP doesn't necessarily work the same from server to server, due to the fact that it can be customized. Using global variables is about the biggest way to ensure you scripts won't work on all servers.
Copy linkTweet thisAlerts:
@spufiauthorOct 30.2003 — So if I define a variable like $_POST["qtyTire"], it should work on all servers, but if I define it like $qtyTire, then it will only work on servers set up to handle it that way? Now, I just have to figure out if I want to be able to use the shorthand version, or stick with the longer one because at least with the longer way the added definition also helps in knowing what the variable is about, ie seeing if it's a variable that's part of a form, session, etc. I think as a PHP newbie, it would be better if I did the long version for now. ?
Copy linkTweet thisAlerts:
@pyroOct 30.2003 — And once you know more PHP, you'll know better than to use the "short version" (register_globals) ?. You can read why [URL=http://us4.php.net/manual/en/security.registerglobals.php]here[/URL], or where it's changed in the php.ini file [URL=http://us4.php.net/manual/en/configuration.directives.php#ini.register-globals]here[/URL]. I'd [i]highly[/i] recommend [b]not[/b] using register_globals... ?
×

Success!

Help @spufi spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...