APC install and cutom PHP.ini with mod_php

software development


I’ve followed the Dreamhost Wiki’s instructions for installing Alternative PHP Cache (APC), but when I get to updateing php.ini, I get stuck. I can only access my php.ini through the shell, and it’s read-only.

I’ve tried creating a custom php.ini and setting .htaccess to find it with “SetEnv PHPRC /home/account/domain.com/folder” but although phpinfo now shows the PHPRC variable set to that folder, it doesn’t actually use the php.ini in it. When I try to use “AllowOverride Options” or “AllowOverride All”, I get a 500 error.

The custom php.ini Wiki page only describes how to set it up with FastCGI and as far as I know, mod_php is needed to use APC. Please help.


Unfortunately, mod_php is not provided for use on shared servers, and has not been for some time now. You can only use PP-CGI, or PHP-FasctCGI on shared servers accounts.


However, APC will work just fine with FastCGI. You’re just not setting PHPRC quite right — I think it needs to be set to the full path to the php.ini file, not just to the folder.


OK, I’ve switched to FastCGI and got the custom php.ini set up. extension_dir is set right in phpinfo(), but there’s no mention of APC.

What could I be doing wrong?


I tried installing PECL/uploadprogress, because the APC wiki page said to in the troubleshooting. Using “sudo pear install pecl/uploadprogress-beta” I get a message that PHP5.2 is required and 4.4 is installed. phpinfo() says 5.2 is running and I don’t see any reason why 4.4 is even on the machine (it’s 2010 and I just created this account a couple weeks ago).

I’ve seen that someone else had this same problem 3 years ago, but nobody gave an answer on how to fix it.


I am also having a problem getting PECL/uploadprogress to install. As a matter of fact, any PECL extension isn’t installing properly. When running the command “pear install pecl/uploadprogress” it runs through the majority of the install until it hits this.

“ERROR: failed to mkdir /usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613”

here is a link to the full shell output after running the install command. http://pastie.org/1916835

Please help, I need some kind of way to provide a progress bar for people uploading large files and since APC’s upload status doesn’t work with FastCGI then this is the only other option I can find.