• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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