Is Your ‘php.ini’ Not Working?

php.ini files might work if you change the file name to php5.ini

I often, I mean very often, scour the internet looking for some technical solution to any number of assorted development problems.  Just today I was stumped by a set of instructions, a relatively easy set of instructions, regarding the editing of a php.ini file on a client’s site. Normally, the solution is out there and requires a bit of coding to get it right – but today however, not only was the solution not ‘obvious’, it was dead simple and could have been summarized in a single sentence.

A bit of background though before I get to the crux of the technical dilemma I encountered; a client site had some WordPress plugin updates.  After the update, the site offered up a warning.  It seems that a calendar plugin that worked amazingly well, was going to throw up errors should any of the contents of the postings made with it, include apostrophes.  The solution, they said, was to turn off “magic_quotes_gpc”.  They also provided a link to the forum for the plugin, where people discussed how to go about turning the feature off.  Now, for the average WordPress user perhaps, this could have proved complex.  But I knew exactly what to do, yet still wanting to be on the safe side, I read through the entire forum discussion.  But no, my initial instinct was right: open the php.ini and add the following:

magic_quotes_gpc = Off


So I visited the site and hit refresh while in the Dashboard; nothing.  No change.  I hit refresh again.  Nada.  Cleared the cash.  Zero difference.  

That’s when the online searching began.  I read up on how to turn Magic Quotes off using php.ini.  I read up a bit on php.ini.  I did everything except for the one alternative option that was offered in the forum, which was to call the hosting provider.  Eventually, I succumbed and what was their solution?  Write the rule in php.ini and it should work.

Needless to say, I was a bit disheartened, but happy to hear that it could simply be a case of the server taking a bit of time to adopt my new rules and with that, I had resolved myself to dropping the issue and revisiting in the morning.  But it was at the very moment of defeat that the tech support staffer made a muffled little sound and said “Wait… …your site’s running PHP 5.3 right?”  I didn’t even have a chance to reply before he said “Just try changing the name of the php.ini file to php5.ini.”

The fix was in, and immediately the warning/error message was gone.

For years now I’ve been writing instructions into php.ini files.  For years now, I’ve read through tutorials and discussion on how to properly address issues.  In the past 5-6 months alone I’ve done at least 5-6 php.ini related searches and never once did that statement come across my eyes.

So, if you’ve been trying to get your php installation to do something and have repeatedly tried to write some instructions into a php.ini file, whether it already existed or you just made your own, and none of the work you did took hold… …maybe try adding a 5 into the file name and see if that makes a difference.

Addendum:  Deeper digging is leading me to believe that this may be a GoDaddy specific issue – but don’t quote me on that.

This entry was posted in Blog. Bookmark the permalink. Trackbacks are closed, but you can post a comment.
    • |
    • |