Page 1 of 2

localhost can't find files

PostPosted: 28. August 2013 22:59
by Alex
Or so I assume. That's what it was telling me, now it just freezes Firefox.

I had XAMPP installed for a time after switching from WAMP. After some weeks I decided I liked WAMP better for it's homepage, so I uninstalled XAMPP, and reinstalled WAMP.
It would not read my PHP files. Browser said it could not find the file. So after varied attempts I uninstalled WAMP, and installed XAMPP again.

Now typing a localhost path into the address bar that I know is valid freezes Firefox and Chrome.

Any advice is very much appreciated!

Regards;
Alex

Re: localhost can't find files

PostPosted: 28. August 2013 23:01
by Alex
I am running Windows 7 Professional, and XAMPP 1.8.2 with Control Panel 3.2.1.

Re: localhost can't find files

PostPosted: 29. August 2013 22:57
by hackattack142
Hello,

Could you post the contents of your Control Panel log window and any errors you see in the Apache error log (if any).

Re: localhost can't find files

PostPosted: 06. September 2013 07:29
by Alex
APACHE Error.log

[Thu Sep 05 13:20:32.836891 2013] [ssl:warn] [pid 6004:tid 252] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Thu Sep 05 13:20:33.743942 2013] [ssl:warn] [pid 6004:tid 252] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Thu Sep 05 13:20:33.781945 2013] [mpm_winnt:notice] [pid 6004:tid 252] AH00455: Apache/2.4.4 (Win32) OpenSSL/1.0.1e PHP/5.5.3 configured -- resuming normal operations
[Thu Sep 05 13:20:33.781945 2013] [mpm_winnt:notice] [pid 6004:tid 252] AH00456: Server built: Feb 23 2013 12:42:00
[Thu Sep 05 13:20:33.781945 2013] [core:notice] [pid 6004:tid 252] AH00094: Command line: 'C:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Thu Sep 05 13:20:33.783945 2013] [mpm_winnt:notice] [pid 6004:tid 252] AH00418: Parent: Created child process 6808
Apache server shutdown initiated...
sl:warn] [pid 6808:tid 264] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Thu Sep 05 13:20:43.112478 2013] [ssl:warn] [pid 6808:tid 264] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Thu Sep 05 13:20:43.151481 2013] [mpm_winnt:notice] [pid 6808:tid 264] AH00354: Child: Starting 150 worker threads.
[Thu Sep 05 13:35:48.113241 2013] [mpm_winnt:notice] [pid 6004:tid 252] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Thu Sep 05 13:35:50.115356 2013] [mpm_winnt:notice] [pid 6808:tid 264] AH00364: Child: All worker threads have exited.
[Thu Sep 05 13:35:50.158358 2013] [mpm_winnt:notice] [pid 6004:tid 252] AH00430: Parent: Child process 6808 exited successfully.
[Thu Sep 05 13:35:59.572897 2013] [ssl:warn] [pid 5428:tid 256] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Thu Sep 05 13:35:59.971920 2013] [ssl:warn] [pid 5428:tid 256] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Thu Sep 05 13:36:00.124928 2013] [mpm_winnt:notice] [pid 5428:tid 256] AH00455: Apache/2.4.4 (Win32) OpenSSL/1.0.1e PHP/5.5.3 configured -- resuming normal operations
[Thu Sep 05 13:36:00.124928 2013] [mpm_winnt:notice] [pid 5428:tid 256] AH00456: Server built: Feb 23 2013 12:42:00
[Thu Sep 05 13:36:00.124928 2013] [core:notice] [pid 5428:tid 256] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Thu Sep 05 13:36:00.126929 2013] [mpm_winnt:notice] [pid 5428:tid 256] AH00418: Parent: Created child process 6788
[Thu Sep 05 13:36:01.069982 2013] [ssl:warn] [pid 6788:tid 272] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Thu Sep 05 13:36:01.488006 2013] [ssl:warn] [pid 6788:tid 272] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Thu Sep 05 13:36:01.527009 2013] [mpm_winnt:notice] [pid 6788:tid 272] AH00354: Child: Starting 150 worker threads.
[Thu Sep 05 13:37:36.079417 2013] [:error] [pid 6788:tid 1676] [client 127.0.0.1:49546] script 'C:/xampp/htdocs/xampp/25.php' not found or unable to stat

That's what I've got. Hope that's diagnostic somehow!

Thanks
*

Re: localhost can't find files

PostPosted: 13. September 2013 21:22
by Alex
UPDATE:

Apache and mySQL are puttering along happily in a green state, all systems apparently nominal.
However, I can't even get:
localhost/xampp/index.html
to show up. Back to step one I guess.

Blessings on everyone who reads this!

*

Re: localhost can't find files

PostPosted: 13. September 2013 22:03
by Altrea
Alex wrote:I can't even get:
localhost/xampp/index.html
to show up.

Surely not. C:\xampp\htdocs\xampp\index.html doesn't exist by default so it cannot get requested successful.

Re: localhost can't find files

PostPosted: 14. September 2013 06:22
by Alex
That was just a gross error on my part to UPDATE:
APACHE and MySQL are green and happy.
localhost/xampp
will give me the homepage, and the demos work.
But nothing else reads.
In my htdocs folder I have a sub-folder named 'php' where I keep my PHP files. So to access this would I not enter
localhost/php/25.php
Firefox thinks for 10- seconds or so, displays my code repeatedly (just echoing 'Hello') across the whole first line of the window and then tries to crash Firefox, sometimes I can close the tab or window fast enough, usually not.

Thanks to all who read!
*

Re: localhost can't find files

PostPosted: 14. September 2013 08:08
by Altrea
If the orange XAMPP Administration Page is working and the demos too the problem is very common with your own code.
Without knowing the sourcecode it is impossible to guess what the problem is.

Re: localhost can't find files

PostPosted: 15. September 2013 02:46
by Alex
Thank you Altrea.
I think this has been a mix up of basic path and stupid coding though, I must say is simple and should not do what it does; It repeats the echo across the first line of the window. Feel free to snarl derisively when you see this.

Code: Select all
<?php

while (1){
   echo 'hello';
}


?>

Someone hinted at me that I haven't closed the *something*. Which would be why it freezes the way it does. Infinite Loop right? So where haven't I closed it?
Stupid path question: htDocs is the root for localhost correct? So any folder or file within htdocs I wanted to access would be thusly:
localhost/php/php25.php

Is there any way to view an index of a folder?
Thanks Ya'll
*

Re: localhost can't find files

PostPosted: 15. September 2013 02:52
by JJ_Tagy
1 is always true, so it will go forever.

For the folder view, you could add the indexes option in a .htaccess file.

Re: localhost can't find files

PostPosted: 15. September 2013 08:09
by Altrea
Alex wrote:It repeats the echo across the first line of the window. Feel free to snarl derisively when you see this.

Code: Select all
<?php

while (1){
   echo 'hello';
}


?>

Infinite loops can't work with the HTTP protocol. Your browser sends a request to a server, the server processes the request and if it has completely processed it it sends a response back to the browser. If the process never ends your browser never gets something back.

Alex wrote:Stupid path question: htDocs is the root for localhost correct?

It's a little bit more complicated than that. Your Apache HTTPD is configurated to listen on port 80 (default port for http). The configurated root directory to serve files is \xampp\htdocs\. Your Windows has configurated a loopback adapter on IP 127.0.0.1 so that IP is routed back to your very own computer. And your Windows has configured a simulated domain name resolution for localhost which is mapped to 127.0.0.1.

Alex wrote:So any folder or file within htdocs I wanted to access would be thusly:
localhost/php/php25.php

http://localhost/php/php25.php would be a request for \xampp\htdocs\php\php25.php

Alex wrote:Is there any way to view an index of a folder?

Only if the request is not a valid ressource file and the folder doesn't contain one of the configurated index files.
http://httpd.apache.org/docs/current/en ... ml#options

best wishes,
Altrea

Re: localhost can't find files

PostPosted: 26. September 2013 01:21
by Alex
Thanks everyone for their insights. I had a path problem (me).
Altrea, thank you for your explanations! You taught me something about servers I didn't know before!
One final stupidity though:
How do I code that to NOT be an infinite loop?

Thanks:
*

Re: localhost can't find files

PostPosted: 26. September 2013 08:34
by Altrea
Alex wrote:How do I code that to NOT be an infinite loop?

Depends what you want to achieve.

Re: localhost can't find files

PostPosted: 30. September 2013 18:15
by Alex
I want it to say 'hello' once. That's it. Hello World. That's it. At this point it doesn't matter because I've solved the main problem; but Hello World? How did I break three lines of code?

Re: localhost can't find files

PostPosted: 30. September 2013 18:36
by JJ_Tagy
Code: Select all
<?php echo "Hello World!"; ?>


Simple as that. You didn't break the code literally. You just need to understand "while" and "for" loops.