• We value your experience with Plesk during 2025
    Plesk strives to perform even better in 2026. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2025.
    Please take this short survey:

    https://survey.webpros.com/

PHP Pages not Parsing

D

dottim

Guest
Parsing PHP Pages
I am having problems parsing PHP pages when I setup Custom Virtual Hosts through Apache. Here is the scenario: I have my web site setup that I require sub domains and their corresponding domain aliases routed to directories through apache, with out using mod_rewrite.

My Solution (ok solutions based on previous posts)
Here is what I have done to make the sub domains and corresponding domains work. In my main httpd.conf file I have done an include on the last line.

Include conf/httpd.conf.include (includes my custom virtual hosts)

My Custom Include Configuration
<VirtualHost ip address:80>
ServerName sub.domain.com
ServerAlias www.sub.domain.com www.anotherdomain.com
DocumentRoot /var/www/vhosts/domain.com/httpdocs/sub
php_admin_flag engine on
</VirtualHost>

My vhost include file
<Directory /var/www/vhosts/domain.com/httpdocs>
php_admin_value open_basedir none
</Directory>

The sub.domain.com, www.sub.domain.com, and www.anotherdomain.com all work and I can view the web page if it is a static html page, as soon as place php into the directory I am ask to download and save the file. No Parsing of PHP happens!

I am missing something?
 
Got my PHP Pages Parsing

Came up with my own solution and where I went wrong. I had to create the php_admin_value(s) within a <Directory> within the <VirtualHost> itself. And after doing this all was ok. Incase anyone needs simiar solution here is the following:

<VirtualHost ip address:80>
ServerName sub.domain.com
ServerAlias www.sub.domain.com www.anotherdomain.com
DocumentRoot /var/www/vhosts/domain.com/httpdocs/sub
<Directory /var/www/vhosts/domain.com/httpdocs/sub>
php_admin_flag engine on
php_admin_value open_basedir none
DirectoryIndex index.html
AddType application/x-httpd-php .html
</Directory>
</VirtualHost>

All my subdomains are included on the last line of my httpd.conf called it httpd.conf.include inserted the following line, Include conf/httpd.conf.include restarted apache and all was ok.
 
Back
Top