Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
248 views
in Technique[技术] by (71.8m points)

php - XAMPP - "This webpage is not available"

I am trying my first Hello World app using php and xampp. I've been getting errors so far and been working through the problems one by one. So far I have:

  1. Saved the php file ("hello.php") on C:xampphtdocs. The following line is in between html "body" tags.

    <?php echo '<p>Hello World</p>'; ?> 
    
  2. Disabled World Wide Web Services from using port 80 as that caused an error on my xampp control panel.
  3. Disabled mySQL56 from using port 3306 as also caused an error on my xampp control panel. At this point, when I turn on xampp control panel, everything looks fine (I say this because all i can see is blue and black writing) except it says I am not running with admin rights.
  4. When I type in http://localhost/hello.php on either Chrome or Firefox, I get "This webpage is not available." error.

Does anyone know what I am doing wrong?

Further notes: I am using Windows 7 and haven't downloaded anything from PHP.

I apologise for perhaps a too wide question. I have tried to be as specific as possible by outlining all actions I have taken.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If admin privileges did not work for you, and you are SURE that your firewall or some other app is NOT blocking Apache ... then:

Make sure, you are visiting the same port, that your Apache is listening to...

Basic http://localhost/ is actually requesting port 80
Secure https://localhost/ is requesting port 443

So in Control Panel, check what ports are 'on' for Apache:
Usually the first one of 2 ports is the one you want - if there is 80, use http://localhost/ ,
if there is 443, you would use https://localhost/

...and lastly - if there is NONE of these 2, you need to write your URL like:
http://localhost:PORT_NUMBER

I hope this will help someone :)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...