PHP Magic Include Path
The apache configuration files in /etc/apache2/conf.d/userdata/*/*/*/cp_php_magic_include_path.conf conditionally set PHP's include_path to a specific list of directories, and because they use the "php_admin_value" command to do so, the include_path cannot later be overridden by .htaccess or within PHP scripts.
When we are running Apache + lsapi the conditions (...) that surround these settings are not met, so the include_path is not set, and everything works fine.
But when we replaced Apache with Litespeed on a couple of our servers for testing, sites broke because the conditions succeed and the include_path is set. This breaks things like Moodle, Magento, and others that need to append to the include_path.
I would like to disable the creation of cp_php_magic_include_path.conf files entirely, since they don't actually seem to set the include_path under Apache anyway.
Further confusing things is the fact that the config file is not there for all vhosts on all servers. On one of our Litespeed servers it appears that every vhost has one, on the other Litespeed server only some accounts have one. On our Apache hosts we have some with none of these conf files at all, some that have a few, and some that seem to have one for every vhost.
So my second, related question would be "what causes this config file to be made for some vhosts but not for others?"
So besides "how do I disable the cp_php_magic_include_path.conf files completely?" I'm curious why some vhosts get them and some don't.
-
I have found that I can disable this config file with this command: /usr/local/cpanel/scripts/ensure_vhost_includes --all-users --force-value=0 --only-check=cp_php_magic_include_path.conf --verbose But I'd still like to know how/why it gets enabled for some users and not for others. 0 -
Thanks, I had stumbled across similar advice to disable "PHP Extensions and Applications Package Magic User Loader" via "WHM Home " Software " Module Installers " PHP Extensions and Applications Package" but that is no longer available in the newest versions of cPanel from what I can see. I mean, I can go into "PHP Extensions and Applications Package" but there is no option to toggle the Magic Loader. I assume that is what I did, just via a different route. 0
Please sign in to leave a comment.
Comments
3 comments