How to configure PHP in Virtual Host?

Posted October 12, 2013 10.4k views
I've installed the virtual host on my server and is working. is working perfectly, but, my problem is when I try in this is no work. if Itry with php: This not work. So . . . I need configure the PHP in my virtual host, someone has a solution for this?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
3 answers
Simply follow the steps outlined in either the LEMP or LAMP stack tutorials.
Hi Pablo!

Thank you for your prompt response.

I installed LAMP previously was running PHP, but stopped working when installing virtual host.
Do you know how to configure virtual host in php? something like this:

php_admin_flag engine on
php_admin_flag safe_mode on
php_admin_value open_basedir "/var/www/vhosts/"

php_admin_flag engine on
php_admin_flag safe_mode on
php_admin_value open_basedir "/var/www/vhosts/"

where I put it? which is the path that handles digital ocean?

by Etel Sverdlov
This tutorial shows you how to set up a new directory, how to grant the correct permissions, how to add content to a new page, how to turn on virtual hosting, and how to, if needed, set up local hosts. Virtual Hosts are used to run more than one domain off of a single IP address and allows you to run multiple sites off of a single DigitalOcean droplet. This tutorial describes how to set up virtual hosts with Apache.