Upgrading to PHP 5.4



I would like to upgrade my VPS to run PHP5.4 to take advantage of it’s reduced memory footprint. I have an active WordPress/bbPress/BuddyPress site that “runs a little hot” on 5.3, and I’ve seen reliable benchmarks suggesting anywhere between a 20-40% reduction in memory consumption when upgrading to 5.4. That being said, I am not an experienced server administrator, and I’m a bit intimidated by the manual configuration involved in the 5.4 install. I’m hoping to take advantage of some of your expertise here to help sort me out.

1) The installation script: http://wiki.dreamhost.com/Installing_PHP5

Is this the most up-to-date install script that I should be using? I find the amount of configuration settings above the #end of user-editable bits# to be daunting.

Obviously I need to specify DOMAIN, source, and installation directories. It also seems like I may need to change a few packages to more recent versions. The script lists this by default:

Update version information here.


Does this look about right? Lastly, the section entitled: # What PHP features do you want enabled? # Should I consider changing anything here, or is this stock setup the way to go?

2) APC integration
I currently have the apc.so package for APC-3.1.9 installed in my /.php/5.3 directory. Judging by the install script, it looks like 5.4 will install its own version of APC. Should I remove the apc module beforehand, or can I just leave it where it is?

3) phprc changes
I assume PHP5.4 still allows for a phprc file that augments php.ini? If so, what directory structure would I use for that. My current phprc in the same /.php/5.3 folder only contains my APC configuration. Can I copy this phprc to, say, /.php/5.4 post-install and it will be applied?

4) Anything else that I might be overlooking?

Thanks for the help guys, I really want to get 5.4 installed, but I’m a bit nervous about somehow mucking it up. Thanks!


The .php/5.3 bit is a custom DreamHost patch to PHP. If you compile it yourself from the php.net sources, this feature will not be available.

When we make PHP 5.4 officially available — which will hopefully be pretty soon — it will use a separate .php/5.4 directory.


Ok, useful to know, thank you. I assume that if I did a custom 5.4 install I would put my APC configuration settings directly into the php.ini?

What about the install script question? Is the default configuration of the script from the DH wiki the most up-to-date (and recommended) method? Apart from changing the relevant directory paths of course…


So 5.4 seems to be available. However when I create a 5.4 directory similar to what I have for 5.3 the phprc file is not being read. At least that is what phpinfo shows.

Any trick to getting this to work?