I am using XAMPP and Apache is running fine. My file is saved at:
C:\xampp\htdocs\php\index.php
But when I open this URL in the browser:
http://localhost/php/index.php
I get this error:
Not Found
The requested URL was not found on this server.
I have tried restarting Apache, checking the file path, and using different browsers, but the issue still exists.
Here is my PHP code:
<?php
$stdname = "Ali";
$stdage = "22";
echo $stdname . "" . $stdage;
?>
http://localhostdoes anIt works!message or some other default apache page appear? Also, try removing thehtdocsportion of the URL, as the document root is likely already refers to that folder.htdocsinto the URL they tried...