[BlueOnyx:26915] Re: How to open_basedir none correctly?

Michael Stauber mstauber at blueonyx.it
Tue Apr 16 13:08:59 -05 2024


Hi Michael,

> I am having problems with WordPress CLI scripts and  open_basedir. The 
> BlueOnyx GUI page will not  accept the folder paths that need to be 
> allowed so I have been manually editing the php.ini to put a ; in front 
> of the open_basedir directive. That works but gets over written every so 
> often and then the errors come back.
> 
> I have open_basedir allowed in both the server and vsite GUI configs but 
> that does not seem to actually do anything.

The 'open_basedir' settings in the GUI affect primarily the settings of 
the PHP that this Vsite uses via the web-browser.

If you need to run PHP scripts from the CLI or via Cronjobs? Then those 
use very restrictive generic settings and have open_basedir locked down 
so much that you can't use it for Vsite scripts.

Like Juerg said: You can add command line options to the PHP CLI call 
like this:

/usr/bin/php -d open_basedir=none /path/to/script.php

But please note: Check which PHP version your Vsite uses. Because if you 
use a Shop PHP PKG, you may need to change the path:

For PHP-8.2 for example you'd use this instead:

/home/solarspeed/php-8.2/bin/php -d open_basedir=none /path/to/script.php

-- 
With best regards

Michael Stauber


More information about the Blueonyx mailing list