Tainara Freitas
Tainara Freitas

Reputation: 11

test.php is returning page not found

It's my first webpage and everything was ok until I had to set up server and install PHP to star coding the back end part.

I installed MySQL 1.4, Visual Studio 2015, VC14, Apache 2.4 and PHP 7.1.

MySQL is running as well as Apache. I was able to open localhost:8080 with the message "It works" but when I try localhost:8080/test.php it opens a 404 page not found.

The error log in Apache folder says:

[php7:error] [pid 3276:tid 956] [client ::1:65240] script 'C:/Apache24/htdocs/test.php' not found or unable to stat

The test.php file is on Apache24/htdocs.

I've already tried so many options, installed and deinstalled versions of PHP, Visual Studio, and nothing. Thank you for helping me.

Here is the httpd file which I edited:

  1. I added those 4 line at the beginning:

    AddHandler application/x-httpd-php .php AddType application/x-httpd-php .php .html LoadModule php7_module "c:/php7/php7apache2_4.dll" PHPIniDir "c:/php7"

  2. Definde the SeverRoot:
    Define SRVROOT "c:/Apache24" ServerRoot "c:/Apache24"

  3. Changed the Listen port
    Listen 8080

  4. List item

    Changed the ServerName localhost: ServerName localhost:8080

  5. DocumentRoot
    DocumentRoot "c:/Apache24/htdocs" "c:/Apache24/htdocs">

Upvotes: 1

Views: 1679

Answers (1)

ester rose
ester rose

Reputation: 1

put your test.php at folder XAMPP/htdocs. XAMMP Panel, turn on Apache and MySQL. Then open your browser and type localhost/test.php

Upvotes: 0

Related Questions