0

Using PHP from the commandline, as root, everything in the php.d/ directory is loaded as expected:

root@tlsv2-eepweb-01:/home/web>php --ini
Configuration File (php.ini) Path: /etc
Loaded Configuration File:         /etc/php.ini
Scan for additional .ini files in: /etc/php.d
Additional .ini files parsed:      /etc/php.d/bcmath.ini,
/etc/php.d/curl.ini,
/etc/php.d/dom.ini,
/etc/php.d/fileinfo.ini,
/etc/php.d/gd.ini,
/etc/php.d/json.ini,
etc...

However, as a non-root user, none of the files are loaded:

web@tlsv2-eepweb-01:~>php --ini
Configuration File (php.ini) Path: /etc
Loaded Configuration File:         /etc/php.ini
Scan for additional .ini files in: /etc/php.d
Additional .ini files parsed:      (none)

Because our web app has a commandline interface, we need php to load all modules from the CLI.

Permissions on php.d/* are permissive.

4
  • This is almost certainly a permission issue. Check the permissions on the directory /etc/php.d itself as well as on the files therein. Also check whether SELinux is active and in enforcing mode. If so, try switching it to permissive move and see whether the problem goes away. Jul 10, 2015 at 18:46
  • Thanks Tilman, I was just about to post that I suspect it's something to do with that devil child SELinux. While all the perms on the php.d/* files are 666, non-root still cannot read them. This would explain why they are not loading. If there's one thing I hate more than Apple, it's SELinux :) Jul 10, 2015 at 20:03
  • I think I've disabled SELinux, but non-root users still don't have access to php.d/* Jul 13, 2015 at 17:35
  • I'm not sure if it's some leftover permission set by SELinux or something else, but non-root users have absolutely no access to this dir, so it makes sense the modules are not loaded. For the time being, I've chowned the entire dir to the web user and the cli now loads all modules. Jul 13, 2015 at 17:41

0

You must log in to answer this question.

Browse other questions tagged .