: Cannot find a file on localhost. 404 Not Found danko@danko-VirtualBox ~ $ sudo service apache2 status * apache2 is running danko@danko-VirtualBox ~ $ php --version PHP 5.5.9-1ubuntu4.17 (cli) (built:
danko@danko-VirtualBox ~ $ sudo service apache2 status
* apache2 is running
danko@danko-VirtualBox ~ $ php --version
PHP 5.5.9-1ubuntu4.17 (cli) (built: May 19 2016 19:05:57)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
danko@danko-VirtualBox ~ $ cd /var/www
danko@danko-VirtualBox /var/www $ cat < testphp.php
<?php phpinfo(); ?>
But request in web browser (http://localhost/testphp.php) returns me, "The requested URL /testphp.php was not found on this server."
What's wrong?
More posts by @Gail5422790
1 Comments
Sorted by latest first Latest Oldest Best
Set DocumentRoot value to "/var/www" which is the path your PHP script is in.
If you have a virtual host entry matching either localhost or the IP address of localhost on your machine then set DocumentRoot value in that virtual host block to "/var/www".
Then restart apache.
See details for DocumentRoot here:
httpd.apache.org/docs/2.4/mod/core.html
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.