I have several sites on my cPanel server running a php script that needs to include a central script.
Up until now I have accomplished this my disabling the open_basedir security feature in the cPanel security center allowing any php scripts to access files outside of their home directory, but I need to harden my server and want to turn on open_basedir protection.
Is there any way I can have a php script include another script from outside the home folder while the open_basedir security feature is enabled?
You can add external path to the php open_basedir configuration in the httpd.conf virtulahost configuration of the username as follows. If external path is /home/username2/public_html/php_directory, add as follows. Restart http.
You can add the above code inside a file, eg domain.conf, in the following directory, so apache updates will not change the values. The values entered in this file will be overridden with the default values inside the main httpd.conf file.