• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue How to update PHP open_basedir and/or httpd.conf server wide?

MHC_1

Basic Pleskian
Server operating system version
Almalinux 9.2
Plesk version and microupdate number
18
How to edit the core Server wide Apache httpd.conf file?

There are bunch of common PHP classes that are used server wide across many domains and accounts. To this end the classes are stored outside the account/domain scope; typically in

/usr/local/lib/php/


But, none of these are working, because according to the PHP error log:
[15-Apr-2025 12:01:42 Europe/London] PHP Warning: include(): Failed opening 'class.file.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/vhosts/website.co.uk/public_html/index.php on line 2
[15-Apr-2025 12:01:42 Europe/London] PHP Fatal error: Uncaught Error: Class "ClassName" not found in /var/www/vhosts/website.co.uk/public_html/index.php:6

However, the PHP.ini file correctly sets:

include_path = ".:/usr/local/lib/php"
...
open_basedir = /var/www/vhosts/michaelbullen.co.uk/:/tmp/:/usr/local/lib/php/

Yet despite the restarts the `phpInfo()` for the Domain still fails to show changes to access to the required directory.

Digging into this it appears that I need to update the httpd.conf file in Apache to permit the non-default open_basedir server wide .


How do I customise `open_basedir` and `include_path` for across ALL accounts/domains in Plesk?​


I believe this is via httpd.conf ; How do I do this?

I DO NOT want to update httpd.conf for each domain, I need to update it centrally for all server domains.


How do I do this?

 
Changes to the main Apache config files will be overwritten. PHP.ini defaults only apply to new domains. The PHP configs are in a file for each domain. The right way to set this is with a command in the terminal: https://support.plesk.com/hc/en-us/articles/12377477741335
Hi. Thank you for your reply.

Ok so according to the documentation you link it says:
For all domains:

mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -e"select name from domains" | grep -v name |while read i; do plesk bin site --update-php-settings $i -settings /var/custom-php-settings.ini; done

Does this mean that for new additional domains on the Plesk server this instruction would need to be run again? Or would additional domains added after this instruction is executed would also contain these custom settings?
 
This is only necessary to change the value for existing domains. For new domains, you can just set the values you want in Service Plans > Example Plan > PHP
 
Two aspects;

1)
This is only necessary to change the value for existing domains. For new domains, you can just set the values you want in Service Plans > Example Plan > PHP

This doesn't work because open_basedir requires the current account's folder ; but if I apply this to a service plan it will apply this to all plan users;

open_basedir = /var/www/vhosts/website.co.uk/:/tmp/:/usr/local/lib/php/

So applying this above line to a service plan means that all users of that service place only get to reach /var/www/vhosts/website.co.uk/ rather than their own relative account scope. Can I use {WEBSPACEROOT} in the custom text area of the PHP editor zone of the service plan ?


2)
I am importing websites from another host; they are being imported with "custom" service plans and I can't see any way to edit these custom service plans. You've already told me about updating current sites but the point is future imports will each be getting "custom" rather than specific service plans I can edit.
 
  1. Yes, you're supposed to use {WEBSPACEROOT}. It has this value by default, so just set it to default to see what it should look like.
  2. I'm not sure if I understood correctly, but if you're manually importing sites one-by-one then you can edit their PHP settings too, no? In any case, if you can't make use of service plans or do this manually, then you should use that guide I sent with the bulk commands.
 
@alvarezcruz thank you for getting back to me.

I have found a workaround that I need to change imported websites from using a "custom" service plan that is uneditable, to giving then a generic catch-all service plan which has the correct PHP settings.

I am finding most of the challenge with Plesk is finding out how to do what needs to be done within the Plesk framework; it isn't very intuitive.

Thank you once again for you help. I conclude that "custom" service plans from imported accounts are not able to be edited.
 
How come you can't edit the custom ones? are they greyed out or what does it look like?

Sorry that was incorrect- I can now edit the "custom" service plans, but this wasn't clear as the "custom" word was not a link ; as per so many other things on Plesk where a [thing] is editable it's name is a link to the edit ability; but for some reason this isn't the case with "custom" - the name is not a link. Anyways. If Plesk was consistent with it's GUI that would be useful!

Thank you for your help here, it's good impetus to set all the imported domains to non-custom service plans anywho I think. Cheers
 
Back
Top