Applicable to:
- Plesk for Linux
- Plesk for Windows
Question
How to change PHP settings in Plesk?
Answer
-
Go to Domains > example.com > PHP Settings.
Note: To allow Plesk resellers/customers customize PHP settings for their domains, visit this KB article.
-
Adjust PHP settings according to your needs and apply the changes. Click on a value field to set a custom value.
-
Go to Service Plans > plan_name > PHP Settings.
-
Adjust PHP settings according to your needs and click Update & Sync.
Note: New settings will not be applied to existing subscriptions, if:
- A subscription is locked from syncing with its service plan.
- Permissions settings allow PHP management in this service plan. To revoke them, visit this KB article.
-
Go to Tools & Settings > PHP Settings > click on a required PHP version (any application) > switch to the php.ini tab.
-
Adjust values for existing PHP parameters or specify your own. Once done, apply the changes.
Note: Customized PHP settings configured on a domain level override directives in php.ini file. To make a domain use values from global PHP configuration, in domain's PHP settings click Reset To Default next to PHP parameters.
In the Plesk PHP Settings menu, the following parameters can be adjusted per domain/service plan:
-
Performance and security settings
- memory_limit
- max_execution_time
- max_input_time
- post_max_size
- upload_max_filesize
- opcache.enable
- disable_functions
-
Common settings
- include_path
- session.save_path
- mail.force_extra_parameters
- open_basedir
- error_reporting
- display_errors
- log_errors
- allow_url_fopen
- file_uploads
- short_open_tag
-
PHP-FPM settings (If PHP is running as FPM application)
- pm.max_children
- pm.max_requests
- pm
- pm.start_servers
- pm.min_spare_servers
- pm.max_spare_servers
Additional PHP parameters or custom values can be specified in the Additional configuration directives field. This field is available for Plesk administrators only.
Use these units to define digital memory capacity:
- K for kilobytes
- M for megabytes
- G for gigabytes
Comments
14 comments
Hello,
but how to set setting that uses PHP for Crontab?
For example i set in global PHH.ini how it written. And also i set it for domain.
short_open_tag=on
But when i start crontab, it runs task as short_open_tag=off
What do i do whong?
Thanks!
@Michael M.
Can you please clarify: do you run domain's Scheduled Task? Do you run it as a command or as a PHP script?
Hi, Alisa!
I run it as PHP Script in Tools & Settings->Scheduled Tasks
Sorry i do no know (or do not have in panel) what is domain Scheduled Tasks. Please let me know what it is.
But i take a script from domain folder that i have made.
Suggest please how i must run it to work, and i will make so)
@Michael M.
You may create a server-wide scheduled task (Tools & Settings > Scheduled Tasks), or for a specific domain (domain > Scheduled Tasks).
Make sure that short_open_tag is specified only once in the php.ini (you may use ctrl+f and writing short_open_tag in a browser to find it on the page).
Try to run the same task as "Run a command", use root user and command like this:
/opt/plesk/php/7.0/bin/php ./var/www/vhosts/example.com/httpdocs/script-name.php
Change the 7.0 to other PHP version for which you have enabled short_open_tag (and the script path).
Check the domain > PHP Settings > View the phpinfo() page, is it showing that short_open_tag on?
Hope this helps!
1. To run domain Sheduler - do not work. Also need to say that here http://prntscr.com/musj8y i have ony one choose. But i know nothing if it is FPM or FAstCGI or maybe one deactivated http://prntscr.com/musjpq
2. /opt/plesk/ - i do not have this folder. i have only /opt/psa and there no php folder inside.
3. >>Check the domain > PHP Settings > View the phpinfo() page, is it showing that short_open_tag on?
When i push this link i get one more error -
Error: Unable to retrieve information about the PHP configuration. - http://prntscr.com/musm5i
Alisa, could you tell - are you from Plesk support?
Thanks!
Hi @Michael M.,
Alisa is indeed from Plesk Support :)
And I suggest getting in contact with us directly as it seemed like there is some technical issue that worth looking into.
You can submit a request to Plesk Technical Support as documented here: https://support.plesk.com/hc/en-us/articles/213608509
I understood.
There is full misunderstandnis in configuration. So:
1. If i run normal Server Sheduler with option - Run a PHP script so it will be processed with this CLI PHP 7.2.15. Its ini is - /etc/php/7.2/cli/php.ini
2. If i run normal Server Sheduler with option - Run a Command so it will be processed with another PHP 7.1.14. Its ini is - /opt/psa/admin/conf/php.ini
3. If i run Domain Scheduler with option - Run a PHP script so it will be processed with this CLI PHP 7.2.15 as in first. But it do use domain specified INI file or domain specified ini setting! There is a big problem, that must be solved in next version of plesk.
Thanks!
Hello @Michael M.!
I checked all three methods you mentioned, and here're the results:
1. Tools & Settings > Scheduled Tasks > Add Task > Run a PHP script
Depending on the selected PHP version (from OS vendor or provided by Plesk), the main php.ini for the PHP engine is used - it can be /etc/php/7.2/cli/php.ini (I guess you're running Debian 9), /etc/php.ini or /opt/plesk/php/7.1/etc/php.ini.
2. Tools & Settings > Scheduled Tasks > Add Task > Run a command
In this case, the used php.ini depends on the PHP binary which is specified in the field Command.
3. Domains > example.com > Scheduled Tasks > Add Task > Run a PHP script
The results here are the same as in the server-wide scheduled task (method 1).
If you face different behavior, I recommend you submit a support ticket with providing the detailed steps which can be used to reproduce the issue (screenshots and screencasts can be very helpful in understanding the issue).
For me only the Common settings can be changed (have drop-down lists), the Performance and security settings and the FastCGI settings are read only - why would that be and what can I do about it?
Hello @Codders,
Do you have administrator access to Plesk?
Most probably it is limited at Service Plans > "Plan Name" > Permissions.
If you do not possess such rights, please, contact your Plesk administrator.
Hi Ivan, I don't see a Service Plans > "Plan Name" > Permissions menu, but I can see this:
Are these the right permissions?
I also spoke with someone from GoDaddy support who had me add
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
to the .user.ini file and also create a info.php file. Then the IIS application pool was recycled, waited for 10 minutes, but the installation still fails with the same error message.
have uninstalled WP and installed Joomla, tried to install JEvents and got the same Internal Server Error
not seeing any new entries in the php error log...
Hi @Codders,
Based on the provided screenshot, you are not Plesk administrator and, thus, the "Service Plans" tab is not available for you
Also, you have no "Hosting performance settings management" permissions granted. As a result, you are unable to edit the "Performance and security settings" and "FastCGI settings"
Ask your Plesk administrator regarding adding such permission
Go to "Plesk > Websites & Domains > example.com > Failed Requests Tracing" and press the "Start Tracing" button
Reproduce the issue, stop tracing and check the created file
Based on the error message try to find the solution
If the issue is still unclear the deeper investigation is required. For this, contact Plesk administrator
Please sign in to leave a comment.