logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: phpinfo gives "404 not found" on laptop
Author
NetLost



Joined: 19 Aug 2006
Posts: 6
Location: Suffolk, UK

PostPosted: Tue 22 Aug '06 12:40    Post subject: phpinfo gives "404 not found" on laptop Reply with quote

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: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 22 Aug '06 14:06    Post subject: Reply with quote

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

PostPosted: Tue 22 Aug '06 23:01    Post subject: Reply with quote

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: 7371
Location: Germany, Next to Hamburg

PostPosted: Wed 23 Aug '06 9:07    Post subject: Reply with quote

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

PostPosted: Wed 23 Aug '06 11:23    Post subject: Reply with quote

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

PostPosted: Wed 23 Aug '06 17:45    Post subject: Reply with quote

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

PostPosted: Wed 23 Aug '06 17:52    Post subject: Reply with quote

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

PostPosted: Fri 25 Aug '06 21:14    Post subject: Reply with quote

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


Reply to topic   Topic: phpinfo gives "404 not found" on laptop View previous topic :: View next topic
Post new topic   Forum Index -> Other Software