Question

How to configure PHP in Virtual Host?

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?


Submit an answer

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!

Sign In or Sign Up to Answer

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.

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>

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