0

I have installed PHP, MySQL, and Apache in my machine by following this tutorial. I created one file info.php to test if php is working on my apache server, but I go message file not found. Then, I tried to place info.php file inside html directory, it worked fine. Is it possible to change it to /var/www not in /var/www/html?

Please help. I am new to linux.

lyhong
  • 101

1 Answers1

0

You can do something like this

 #open suphp.conf file 
 gksu "gedit /etc/suphp/suphp.conf
 #or like this
 sudo nano /etc/suphp/suphp.conf
 #change the document root folder 
 docroot=/var/www/  
 #to
 docroot=/home/user/public_html/
 #restart apache
 sudo service apache2 restart  
 #or like this
 sudo /etc/init.d/apache2 restart
 #test your new location
 echo "<?php echo 'whoim = '.exec('/usr/bin/whoami');?>" | tee /home/user/public_html/whomi.php

Now open your browser and navigate to localhost/whomi.php and you should see your ID. More detailed documentation can be found here

Zuko
  • 1,277