Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

On our Amazon EC2 instance, I uninstalled PHP5.3 (yum remove php) and installed PHP 5.5, which also bundled in Apache 2.4 (yum install php54).

For some reason, my php.ini file is no longer being read. It looks like it may be deprecated, and maybe I should use /etc/php-5.5.ini instead - but that one isn't being read either! (Strangely, I can't find any documentation on this. Googling "php-5.5.ini" (with quotes) returns no helpful results!??)

Running php --ini, I get this:

[ec2-user@ip ~]$ php --ini
Configuration File (php.ini) Path: /etc/php-5.5.d
Loaded Configuration File:         /etc/php-5.5.d/php.ini
Scan for additional .ini files in: /etc/php-5.5.d
Additional .ini files parsed:      /etc/php-5.5.d/apc.ini,
/etc/php-5.5.d/bz2.ini,
/etc/php-5.5.d/calendar.ini,
/etc/php-5.5.d/ctype.ini,
/etc/php-5.5.d/curl.ini,
/etc/php-5.5.d/dom.ini,
/etc/php-5.5.d/exif.ini,
/etc/php-5.5.d/fileinfo.ini,
/etc/php-5.5.d/ftp.ini,
/etc/php-5.5.d/gd.ini,
/etc/php-5.5.d/gettext.ini,
/etc/php-5.5.d/iconv.ini,
/etc/php-5.5.d/json.ini,
/etc/php-5.5.d/mbstring.ini,
/etc/php-5.5.d/mysqlnd.ini,
/etc/php-5.5.d/mysqlnd_mysql.ini,
/etc/php-5.5.d/mysqlnd_mysqli.ini,
/etc/php-5.5.d/pdo.ini,
/etc/php-5.5.d/pdo_mysqlnd.ini,
/etc/php-5.5.d/pdo_sqlite.ini,
/etc/php-5.5.d/phar.ini,
/etc/php-5.5.d/php.ini,
/etc/php-5.5.d/posix.ini,
/etc/php-5.5.d/shmop.ini,
/etc/php-5.5.d/simplexml.ini,
/etc/php-5.5.d/sockets.ini,
/etc/php-5.5.d/sqlite3.ini,
/etc/php-5.5.d/sysvmsg.ini,
/etc/php-5.5.d/sysvsem.ini,
/etc/php-5.5.d/sysvshm.ini,
/etc/php-5.5.d/tokenizer.ini,
/etc/php-5.5.d/xml.ini,
/etc/php-5.5.d/xml_wddx.ini,
/etc/php-5.5.d/xmlreader.ini,
/etc/php-5.5.d/xmlwriter.ini,
/etc/php-5.5.d/xsl.ini,
/etc/php-5.5.d/zip.ini

Neither ini file are listed here. There's a /etc/php-5.5.d/php.ini, but it is blank except for this message: ; The php.ini file has moved to /etc/php-5.5.ini.

But again, /etc/php-5.5.ini isn't being read either...

I'm not sure what the ".d" naming scheme means here - is it "default" or "daemon" or something else?

What can I do to get either of these INI files read? Or do I just need to throw everything into /etc/php-5.5.d/php.ini?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Your PHP is configured to read all .ini files in the /etc/php-5.5.d folder. This allows for logical separation of settings - APC's settings go into apc.ini, memcached's go in memcached.ini, etc.

You can put any settings you want to modify in /etc/php-5.5.d/php.ini or create a new .ini in the folder. /etc/php-5.5.d/DOOManiac.ini would work just fine, for example.

Regarding .d folders: http://unix.stackexchange.com/questions/4029/what-does-the-d-stand-for-in-directory-names

share|improve this answer
    
That's what it looks like, except for the fact that /etc/php-5.5.d/php.ini is devoid of any 'default' settings and merely points the user to /etc/php-5.5.ini. I know it would work, but it feels kind of hacky, so I just wanted to check and make sure that yes this is what I should really do. Thanks –  DOOManiac Jan 2 at 15:10
    
Also, thanks for clarifying the .d issue! –  DOOManiac Jan 2 at 15:11
1  
An empty php.ini file will still get PHP's internal defaults. Some distributions pre-populate the default php.ini file with a big long list of default settings, but it's not strictly necessary. You can run PHP with no php.ini file whatsoever, in fact. –  ceejayoz Jan 2 at 15:13
    
Okay, I bit the bullet and did sudo cp /etc/php-5.5.ini /etc/php-5.5.d/php.ini. Everything works fine now. I guess I'll just delete all these old INI files and tell everyone it's in a different place now... –  DOOManiac Jan 2 at 15:18
    
Other option - symlink /etc/php-5.5.ini to /etc/php-5.5.d/php.ini or the other way around. –  ceejayoz Jan 2 at 15:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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