skip to Main Content

I’ve installed php, mysql, apache with WAMP for windows 10. When I go to http://localhost there is not any problem, the appropriate page is shown. The server is up and running, but when I try to open http://localhost/test.php it gives me 404 not found error. By the way I’ve put the index.html and test.php into wamp64/bin/apache/apache2.4.46/htdocs. The server can access neither index.html in that directory nor test.php. Your help is welcome.

2

Answers


  1. Chosen as BEST ANSWER

    Like @Selim Achour said I looked to the error logs and I found that apache server wasp/ searching the test.php in a folder called wamp/www/test.php. When I move the test.php from htdocs/test.php to www/test.php it works perfectly. I was following instructions from a book that I'd been reading. In that book's instructions, it is clearly stated that you should move test.php into htdocs. That was what got me confused. Thank you all for your effort.

    The error: Sat Sep 26 13:14:03.134587 2020] [php7:error] [pid 8220:tid 1204] [client ::1:6466] script 'C:/wamp64/www/test.php' not found or unable to stat


  2. WAMPServer’s DocumentRoot folder is C:wamp64www BUT You should NEVER place your scripts into that folder!!!

    Make a subfolder and use that i.e. C:wampwwwtest1 put your test.php in there and run using locahost/test1/test.php

    Better still create a Virtual Host for all your test areas and development site folders. See THE NEED for VIRTUAL HOSTS and then WAMPServer 3 Create a Virtual Host, the easy way

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search