Php.ini help (Unfortunately)



Like many others, I have attempted to follow the guide on implementing a custom php.ini file which can be found at

Unfortunately, I can’t seem to get it working properly.

I’ve created the cgi-bin folder in my web root, copied the php.cgi and php.ini files into it using the script. And I created the .htaccess file in the web root, containing the prescribed text. I even “Protected my PHP file” with .htaccess file that resides in the cgi-bin folder. I even tried removing the .htaccess file in the cgi-bin folder.

All this, and still, the phpinfo(), as seen at, states that it is looking for php.ini at /etc/php5/cgi/php.ini

needless to say, none of the modifications in my php.ini file have taken effect yet either.

Any help would be greatly appreciated.



It’s really hard to guess what might be wrong from the information in your post.

Assuming that you got the php.cgi and the php.ini files properly copied into and properly modified that php.ini, then it is pretty safe to say that your problem must be with your .htaccess file(s) not properly implementing the required handler.

I suggest redoing it, and checking your progress each step of the way:

  1. After copying the files bia the script, physically check to make sure they are, in fact, in the cgi-bin as expected. - if not, review the wiki and try again.

  2. After making your edits to php.ini, double check to make sure they are present in the appropriate file in cgi-bin - if not, review the wiki and try again.

  3. After creating the .htaccess file that enables the handler required to force the use of your new configuration, check the output of phpinfo() to see if your new php.cgi and php.ini are, in fact being used. if not, review the wiki and try again.

  4. After creating any .htaccess file to “protect your php file”, repeat step 3 above to see if your new php.cgi and php.ini are, in fact being used. if not, delete that last .htaccess file, review the wiki and try again.

Make sure and clear your cache between “checks”. The process described in the wiki has been done thousands of times, and does work if the instructions are followed precisely. :wink:

If all else fails, and you can get past step 2 above and confirm your changes are being made to the php.ini file in your cgi-bin directory, possibly posting the contents of your .htaccess file(s) could help other see where you might have gone wrong.



Okay… thanks again for your help. And you were right, that wiki does work. It was me that was broke.

I had going to revision/htdocs/. once I copied the cgi-bin and the .htaccess inside the htdocs folder it worked. Thanks again for your help.


You are most welcome, and I’m glad that you found the problem and got it fixed! I didn’t do anything … you fixed it (I just “encouraged you” :wink: )!



That’s an awesome line. I want that on my headstone.

Max discount on any plan with promocode SCJESSEYTOTAL