Report this

What is the reason for this report?

How to configure PHP in Virtual Host?

Posted on October 12, 2013

I’ve installed the virtual host on my server and is working.

mydomain.com is working perfectly, but, my problem is when I try in mydomain.com/info.php this is no work. if Itry with php:

<?php echo “example text with php!”; ?>

This not work. So . . . I need configure the PHP in my virtual host, someone has a solution for this?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Simply follow the steps outlined in either the LEMP or LAMP stack tutorials.

Hi Pablo! <br> <br>Thank you for your prompt response. <br> <br>I installed LAMP previously was running PHP, but stopped working when installing virtual host. <br>Do you know how to configure virtual host in php? something like this: <br> <br><Directory /var/www/vhosts/vhost.com/httpsdocs> <br> <IfModule sapi_apache2.c> <br> php_admin_flag engine on <br> php_admin_flag safe_mode on <br> php_admin_value open_basedir “/var/www/vhosts/vhost.com/httpsdocs:/tmp” <br> </IfModule> <br> <IfModule mod_php5.c> <br> php_admin_flag engine on <br> php_admin_flag safe_mode on <br> php_admin_value open_basedir “/var/www/vhosts/vhost.com/httpsdocs:/tmp” <br> </IfModule> <br> </Directory> <br> <br>where I put it? which is the path that handles digital ocean? <br> <br>

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.