Overriding PHP.INI

It’s a while since I’ve needed to override the php.ini file on a per-site basis, and I hadn’t realised that since PHP 5.3, the process has changed slightly. Now, if you want a local ini file to be read, you need to name it .user.ini (note the dot at the beginning of the filename), and not php.ini. I couldn’t understand why my local php.ini was being ignored.

As before, place your .user.ini file in the directory within which you want your overrides to apply. The syntax is exactly the same as in the php.ini file itself. The manual doesn’t make this terribly clear; see the user-contributed notes.

This entry was posted in PHP, Web development. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>