• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Plesk 10.1.1 per-domain PHP settings

MassimoP

Basic Pleskian
Hi,
I need help on how to set PHP settings for specific domain and/or subdomains.

I found tutorials for Plesk 10.3, 10.4 but nothing for Plesk 10.1.1.

Thanks in advance
 
Here is what I read in one of the configuration file:

# ATTENTION!
# DO NOT MODIFY THIS FILE OR ANY PART OF IT. THIS CAN RESULT IN IMPROPER PLESK
# FUNCTIONING OR FAILURE, CAUSE DAMAGE AND LOSS OF DATA. IF YOU REQUIRE CUSTOM
# MODIFICATIONS TO BE APPLIED TO THE CONFIGURATION, PLEASE, PERFORM THEM IN THE
# FOLLOWING FILE(S):
#[PATH]/vhost.conf
#[PATH]/vhost_ssl.conf
#[SUBDOMAIN_PATH]/vhost.conf

It seems it is possible to do what I need (at least by using Apache php_admin_flag, php_admin_value, ecc...)

I don't think I can upgrade to other Plesk versions on my server.
 
I solved the problem by myself.

Follow the steps (Plesk 10.1.1):
1. Modify the file: [PATH]/vhost.conf (or [PATH]/vhost_ssl.conf or [SUBDOMAIN_PATH]/vhost.conf)
2. Reconfigure the domain: /usr/local/psa/admin/sbin/httpdmng --reconfigure-domain [DOMAIN]

[DOMAIN] is always the main domain (even if you are configuring a subdomain)
[PATH] is something like this: /srv/www/vhosts/[DOMAIN]/conf
[SUBDOMAIN_PATH] is like this: /srv/www/vhosts/[DOMAIN]/subdomains/[SUBDOMAIN]/conf

The vhost.conf file has the structure (this example changes only the PHP safe_mode flag):
<Directory /srv/www/vhosts/[DOMAIN]>
php_admin_flag safe_mode on
</Directory>

or if you are changing the configuration of a subdomain:
<Directory /srv/www/vhosts/[DOMAIN]/[SUBDOMAIN]>
php_admin_flag safe_mode on
</Directory>


Hope this could help.
 
Last edited:
Back
Top