Question
How to change PHP parameter for all domains?
For example, change open_basedir
parameter for all domains?
Answer
Warning: current example is for changing open_basedir value to none. Select another value if needed.
For already created domains:
Note: the further instructions are intended for server administrators with direct RDP/SSH access to the server.
If direct SSH/RDP access to the server is not possible, contact server administrator for further assistance.
Click here to reveal information for Linux.
-
Connect to the server using SSH.
-
Create a list of domains:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql psa -uadmin -Ne"select name from domains where htype='vrt_hst'" > /root/list.txt
-
Create a
php.txt
file with the neededopen_basedir
configuration, e.g:open_basedir = none
Note: the above configuration depending on the needs.
-
Run the following command to apply settings from
php.txt
created on the previous step:# cat /root/list.txt | while read dom; do /usr/local/psa/bin/site --update-php-settings $dom -settings /root/php.txt;done
Click here to reveal information for Windows.
-
Connect to the server via RDP.
-
Create a list of domains:
C:> plesk db -Ne"select name from domains where htype='vrt_hst'" > C:list.txt
-
Create a
php.txt
file with the neededopen_basedir
configuration, e.g:open_basedir = none
Note: the above configuration depending on the needs.
-
Run the following command to apply settings from
php.txt
created on the previous step:C:> for /f "skip=1 tokens=1" %a in (C:list.txt) do @"%plesk_cli%site.exe" --update-php-settings %a -settings C:php.txt
For new domains:
Set up open_basedir value to none at Service Plans > plan_name > PHP Settings.
Note: Service Plans are available for Web Host and Web Pro editions only.
Alternatively, modify panel.ini
configuration file:
-
Install the Panel.ini Editor extension in Plesk How to manage Plesk extensions (install, disable, remove, update)
-
Go to Plesk > Extensions > My Extensions > Panel.ini Editor > Go To Extension > Editor.
-
Set the default
open_basedir
tonone
:if there is no [php] section in Panel.ini, add the following:
[php]
settings.general.open_basedir.default="none"Otherwise, add the directive to [php] section:
settings.general.open_basedir.default="none"
-
Click Save: