• Dear Pleskians! The Plesk Forum will be undergoing scheduled maintenance on Monday, 7th of July, at 9:00 AM UTC. The expected maintenance window is 2 hours.
    Thank you in advance for your patience and understanding on the matter.

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