On Plesk Obsidian 18 - How to update PHP open_basedir and/or httpd.conf server wide?
0
votes
0
answers
32
views
We have moved a server over from CentOS (finally) to Alma Linux, part of this move is going from WHM to Plesk. The server hosts around 50 websites.
I have a lot of misgivings about Plesk, but regardless of that, there is a critical issue I can't resolve and would like to know how:
We have a 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, on Plesk, 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
This above error was caused by the
open_basedir
not also containing the same folder.
However, the PHP.ini file (edited via Plesk interface) correctly sets:
include_path = ".:/usr/local/lib/php"
...
open_basedir = /var/www/vhosts/website.co.uk/:/tmp/:/usr/local/lib/php/
Yet despite the restarts the phpInfo()
for the domain still fails to show changes to permit access to the required directory.
Digging into this it appears that I may need to update the httpd.conf
file in Apache to permit the non-default open_basedir=
server wide .
So:
1) How could I set Plesk to permit a certain folder on the server to be accessible to all accounts?
2) How do I customise open_basedir
and include_path
for across ALL accounts/domains in Plesk?
- I believe this is via httpd.conf ; How would I do this to avoid any updates being overwritten by Plesk?
- I DO NOT want to update httpd.conf for each domain, I need to update it centrally for all server domains.
# How can I do this?
Many thanks for being more helpful than Plesk Support.
Asked by Martin
(143 rep)
Apr 16, 2025, 08:49 AM