Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am currently setting up a new Mac Mini Lion server. I am now installing mongodb and apc extension. I want to include the ini settings for the extensions on the /etc/php.d directory (similar with my server settings on centOS)

I tried to do

php -i | grep php.d

and it gives me

Scan this dir for additional .ini files => /etc/php.d/
Additional .ini files parsed => /etc/php.d/apc.ini,
PHP_INI_SCAN_DIR => /etc/php.d/
_SERVER["PHP_INI_SCAN_DIR"] => /etc/php.d/

But when I tried on phpinfo() on a php script, I got:

Configuration File (php.ini) Path   /etc
Loaded Configuration File   /private/etc/php.ini
Scan this dir for additional .ini files     (none)
Additional .ini files parsed    (none) 

The php environment on CLI and php script is the same which php


and on php script page

PATH /usr/bin:/bin:/usr/sbin:/sbin

Is there anything I should set on the apache side?

I am thinking to stick with the Built-in apache and php from the mac installation because I like the Server App from Mac.

share|improve this question

closed as off-topic by Falcon Momot, Ward, Jenny D, MadHatter, dawud Sep 12 '13 at 15:25

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is a site dedicated to professionals; novice questions are off-topic. Please see the Help Center for more information on topicality. The best advice we can give you is to hire a professional to help you out." – Falcon Momot, Ward, Jenny D, MadHatter, dawud
If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 3 down vote accepted

Looks like PHP CLI is using /etc/php.ini file, verify with:

php -i | grep 'Configuration File'

While Apache is loading the /private/etc/php.ini file:

Configuration File (php.ini) Path   /etc
Loaded Configuration File   /private/etc/php.ini

Point to the right php.ini file which you want by PHPINIDir directive.


Don't know why phpinfo() ignore the additional .ini files but it can be force to scan in 2 ways:

  1. insert the below line before starting Apache in init script

    export PHP_INI_SCAN_DIR=/etc/php.d
  2. add the following to the Apache configuration file:

    php_value include_path "/etc/php.d"
share|improve this answer
/etc/ directory is actually just a symlink of /private/etc/ – hachiari Aug 21 '11 at 7:21
lrwxr-xr-x@ 1 root wheel 11 7 25 17:43 etc -> private/etc – hachiari Aug 21 '11 at 7:21
I tried php -i | grep 'Configuration File' and it gave me Configuration File (php.ini) Path => /etc Loaded Configuration File => /private/etc/php.ini – hachiari Aug 21 '11 at 7:28
What's the output of ls -l /etc/php.d/? Run strace -ofile -f -o /tmp/apache.log /script/to/start/apache, paste the log to pastebin and insert link here. – quanta Aug 21 '11 at 8:29
for ls -l /etc/php.d/ -rw-rwxrwx 1 root wheel 213 Aug 21 06:13 apc.ini -rw-rwxrwx 1 root wheel 19 Aug 21 06:11 mongo.ini – hachiari Aug 21 '11 at 10:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.