Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

localhost can't find files


  • Please log in to reply
12 replies to this topic

#1 XZTNL

XZTNL

  • Members
  • 7 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:04:47 AM

Posted 29 August 2013 - 02:57 PM

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.

 

My registry was cleaned between all but one step.

Any advice is very much appreciated!

Regards;
*

 



BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:05:47 AM

Posted 29 August 2013 - 07:39 PM

Is it freezing, or does the browser eventually time out?



#3 XZTNL

XZTNL
  • Topic Starter

  • Members
  • 7 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:04:47 AM

Posted 03 September 2013 - 08:22 PM

It is freezing in the sense that it locks up the browser.  After multiple attempts to "X" out, it gives me "the wheel".  After other strategies and attempts I have found that when WIndows asks if I want a way out, it is the only way out.



#4 XZTNL

XZTNL
  • Topic Starter

  • Members
  • 7 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:04:47 AM

Posted 03 September 2013 - 08:23 PM

It is freezing in the sense that it locks up the browser.  After multiple attempts to "X" out, it gives me "the wheel".  After other strategies and attempts I have found that when WIndows asks if I want a way out, it is the only way out.

Sorry for the double post!

 

(No it doesn't time out)



#5 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:05:47 AM

Posted 04 September 2013 - 11:04 AM

Maybe WAMP has timeouts disabled by default. Are you sure you are using the correct port, firewalls are open as necessary, etc. Is Apache running? There are a ton of possible issues. Are you serving up pages from the same system on which you are developing?



#6 XZTNL

XZTNL
  • Topic Starter

  • Members
  • 7 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:04:47 AM

Posted 08 September 2013 - 11:31 PM

I'm back on XAMPP permenantly, WAMP is dead to me.

 

Update:

 

localhost finds the file (occasionally) and then goes blank for a

                "
Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\php\25.php on line 5

                ".

My PHP is thusly:

<?php

while (1){
    echo 'hello';
}

?>


which should be perfectly legtimate code.  Although it does loop the 'hello' statement.

 

Thank you:

*


Edited by XZTNL, 08 September 2013 - 11:33 PM.


#7 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:05:47 AM

Posted 09 September 2013 - 09:17 AM

If you are running that code expecting it to be displayed in the browser, it isn't going to be displayed until the php has completed, or the buffer in apache is full, or you force the buffer to dump to the webpage. I think what you are seeing is inconsistent results based on the fact that apache is being relied on to know when to dump the contents of the page, and that could be based on any number of conditions.

 

It either finds the file or it does not. The app cannot 'sometimes' find the file.

 

Try this instead:

 
<?php 
   echo "Hello<br>";
   echo date();
?>

 

That should run every time without fail. Also, you can see if a file exists:

 

 
<?php 
   if(file_exists("url.to.file"))
  {
    echo "File exists<br>";
  }
  else
  {
    echo "File does not exist.<br>";
  }
?>

 

That will tell you for sure if the problem is indeed an inability to find the file.



#8 XZTNL

XZTNL
  • Topic Starter

  • Members
  • 7 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:04:47 AM

Posted 13 September 2013 - 03:19 PM

Okay then.  Both files with new code result in "Object not found!"

Apache and MySQL are both green and apparently content in their state.  "Status change detected: running"

I even tried

http://localhost/xampp/index.html

Giving the predictable "Object not found!"

I'm out of ideas.

Reinstall Firefox?  Even though it does this in Chrome too?

Save everything and go to an earlier backup state?

 

If I may;  Where is it in my previously stated code, you see that it doesn't close?  I peeled it off of NewBoston.

 

As always, ever so grateful:

*



#9 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:05:47 AM

Posted 13 September 2013 - 08:06 PM

I mistated.The while loop is going to loop forever, so the loop never opens.

 

I don't think you need to reinstall anything, but you are using the wrong path. If you are placing your files in the htdocs folder like you are supposed to be, then the correct path to your files woud be http://localhost/index.html or just http://localhost

 

See how that works.



#10 XZTNL

XZTNL
  • Topic Starter

  • Members
  • 7 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:04:47 AM

Posted 14 September 2013 - 12:13 AM

Neither of those objects are found.

 

My files are in the htdocs folder (and a subfolder).

Now while

   localhost/xampp/

gives me the homepage, nothing else is accessible.

The examples in the left hand frame work though, which is odd.

 

Thank you for your continued support;

*



#11 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:05:47 AM

Posted 14 September 2013 - 05:13 AM

I use xampp daily, and there is never any time that I used 'xampp' anywhere in the path name to find my files. When Apache is running, it sees htdocs as the base folder. If you can get to the xampp homepage, and xampp folder, then you should be able to drop a test file into the xampp directory and get to it through direct access. And if you can access that directory, there is no reason why you can't access a simple file in the the htdocs directory, unless you have the permissions for that directory goofed up.

 

If you are dropping your own package (or folder) into htdocs, then you will need to include that folder name as part of the path:

localhost/myFolder/myFile.php

 

I can't think of anythign else. If you can access the xampp index page like you said, then the port setting is correct, and the firewall is open. All that is left is a path problem. Where is the full path to your file, and what url are you using to try and access it?



#12 XZTNL

XZTNL
  • Topic Starter

  • Members
  • 7 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:04:47 AM

Posted 23 September 2013 - 12:10 AM

I have determined, but have not yet rectified, the underlying problem:

I am a moron.

localhost/php/23.php

takes me to

c:\XAMPP\htdocs\php\23.php

correct?

It seems to work for me.

And it DOES find the bloody file.

 

Thank you for helping narrow it down to the simple stuff.

 

*



#13 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:05:47 AM

Posted 23 September 2013 - 06:24 AM

Yes. Your path was not correct. Glad you got it worked out.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users