Author |
|
NetLost
Joined: 19 Aug 2006 Posts: 6 Location: Suffolk, UK
|
Posted: Tue 22 Aug '06 12:40 Post subject: phpinfo gives "404 not found" on laptop |
|
|
Hi
New user here
I have exactly the same "localhost" & "localdomain" congiguration of MySQL, Apache2 and php5 on both my online Windows XP Pro desktop and my XP Home laptop. Everthing is fine on the desktop.
On the laptop using any browser "http://localhost/phpinfo.php" returns "404 not found."
"http:/localhost/" returns the Apache window.
Following many frustrating hours searching for solutions I'm seeking help in this forum. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Tue 22 Aug '06 14:06 Post subject: |
|
|
Sure that the real name of that file id phpinfo.php? Windows normaly don't show known file extension.
404 allways mean that the file is not found in the webroot. please check the name of that file and where you placed it. |
|
Back to top |
|
NetLost
Joined: 19 Aug 2006 Posts: 6 Location: Suffolk, UK
|
Posted: Tue 22 Aug '06 23:01 Post subject: |
|
|
Hi James
Thanks for quick reply
"phpinfo.php" is located in "htdocs." "Hello.html" in the same location renders "Hello" in the browser so the location is being found.
Checking through the files again on the laptop I discover that in "httpd.conf" a sub-file appears "cgi-bin" containing a text document "printenv.pl" which is absent from my desktop computer. "printenf.pl" contains the following code.
#!c:/Perl/bin/Perl.exe
##
## printenv -- demo CGI program which just prints its environment
##
print "Content-type: text/plain\n\n";
foreach $var (sort(keys(%ENV))) {
$val = $ENV{$var};
$val =~ s|\n|\\n|g;
$val =~ s|"|\\"|g;
print "${var}=\"${val}\"\n";
}
I don't know how it got there. Could this be the culprit?
Can I safely delete "cgi-bin" and "printenv.pl?"
I'd appreciate advice on removal procedure. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Wed 23 Aug '06 9:07 Post subject: |
|
|
NetLost wrote: |
--> demo CGI program which just prints its environment
I'd appreciate advice on removal procedure. |
that should say all. it is a demo file for perl. if you don't does perl, you can delete that folder with the files in it.
is in the htdocs folder an index.htm or index.html ? if Yes, move it somewhere. Than Apache will show you all files in htdocs. Than you must see your phpinfo.php Click than on the link from phpinfo.php of the Apache generated page. |
|
Back to top |
|
Jorge
Joined: 12 Mar 2006 Posts: 376 Location: Belgium
|
Posted: Wed 23 Aug '06 11:23 Post subject: |
|
|
James Blond wrote: | NetLost wrote: |
--> demo CGI program which just prints its environment
I'd appreciate advice on removal procedure. |
that should say all. it is a demo file for perl. if you don't does perl, you can delete that folder with the files in it.
is in the htdocs folder an index.htm or index.html ? if Yes, move it somewhere. Than Apache will show you all files in htdocs. Than you must see your phpinfo.php Click than on the link from phpinfo.php of the Apache generated page. |
Actually leave the folder but remove the script alias in httpd.conf is the correct way to remove it. |
|
Back to top |
|
NetLost
Joined: 19 Aug 2006 Posts: 6 Location: Suffolk, UK
|
Posted: Wed 23 Aug '06 17:45 Post subject: |
|
|
Hi Guys
Thank you for your reponses
The folder "cgi-bin" was for some reason located within the "conf" folder.
Rather than delete or otherwise change the "aliases" I relocated it back to its default location "Apache2" folder as on my other machine. I tested it in the browser but "phpinfo.php" was still 404 not found whilst "Hello.html" rendered "Hello" in the browser.
I have again checked through the configuration on both machines including the Windows folders and find:-
httpd.conf----Machines match
php.ini--------Machines match
php5ts.dll-----Machines match
However in Windows folders there is a miss-match in "c:/PHP" as follows:-
Desktop------Laptop
Dev--------------Dev
Examples--------Non-existent
Ext---------------Non-existent
Extras------------Extras
Pear--------------Pear
The "Ext" folder contains 6.02mb of data.
Should I copy "Examples" and "Ext" from my desktop and paste to my laptop? |
|
Back to top |
|
Xing Moderator
Joined: 26 Oct 2005 Posts: 49
|
Posted: Wed 23 Aug '06 17:52 Post subject: |
|
|
Seems you made a mess by placing/removing folders all over the place.
Remove all php and apache folders and files and start over again, use the guide at www.apachelounge.com/viewtopic.php?t=570
X |
|
Back to top |
|
NetLost
Joined: 19 Aug 2006 Posts: 6 Location: Suffolk, UK
|
Posted: Fri 25 Aug '06 21:14 Post subject: |
|
|
Hi Guys/Dolls
My Windows XP Home laptop is now working fine and without resorting to any programme fixes.
I thought I'd share what worked for me.
When writing ".php" documents and saving them in "htdocs" be sure to change the type of file to "all files." It avoids the document you are saving having an additional "dot extension" appended after your ".php" hence rendering 404 not found in your browser.
Thanks for contributions from all posts.
NetLost |
|
Back to top |
|