Mobile app version of vmapp.org
Login or Join
Gail5422790

: 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:

@Gail5422790

Posted in: #Apache2 #Php

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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Gail5422790

1 Comments

Sorted by latest first Latest Oldest Best

 

@Angela700

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme