Hello,
There seems to be a bug in plesk where the php in sub domain will not work and in main domain it works.!!. The below are the steps to overcome it.
Open the subdomain’s conf folder at /var/www/vhosts/$domain.com/subdomains/$subdomainname/conf
cd /var/www/vhosts/$domain.com/subdomains/$subdomainname/conf vi vhost.conf
and add the below config, make sure you change the $domain.com to your domain name and $subdomainname to your subdomain name.
<Directory /var/www/vhosts/$domain.com/$subdomainname> <IfModule mod_perl.c> <Files ~ (\.pl$)> SetHandler perl-script PerlHandler ModPerl::Registry Options ExecCGI allow from all PerlSendHeader On </Files> </IfModule> <IfModule sapi_apache2.c> php_admin_flag engine on </IfModule> <IfModule mod_php5.c> php_admin_flag engine on </IfModule> <IfModule mod_python.c> <Files ~ (\.py$)> SetHandler python-program PythonHandler mod_python.cgihandler </Files> </IfModule> <IfModule mod_fcgid.c> <Files ~ (\.fcgi)> SetHandler fcgid-script Options +FollowSymLinks +ExecCGI </Files> </IfModule> Options -Includes +ExecCGI </Directory>
Then execute the below two scripts
/usr/local/psa/admin/sbin/websrvmng -u --vhost-name=$domain.com /usr/local/psa/admin/sbin/httpdmng --reconfigure-all