Can I use the phprc file for all versions of PHP?


#1

We’re using the same phprc file for all versions of PHP that our sites use.

For example:
.php/5.3/phprc
.php/5.4/phprc
.php/5.5/phprc
.php/5.6/phprc

Is it possible to just use one phprc file for every version of PHP?

One of our sites automatically got upgrade to the next version of PHP and we forgot to create the phprc for it and it created issues on the website.


#2

I haven’t tried this, but you could create your desired phprc in the 5.6 directory, then symbolically link to it from the other version directories.

Otherwise, when I look at my PHP environment, it is only looking for phprc in the associated version directory.


#3

Yeah, that’s what I thought. Too bad it doesn’t look in .php/ first.

I guess the only solution is is to create a version folder for every version up to 7.0/ (or so) and put the phprc file in each folder. That way if we forget to create the new phprc it won’t break our site.


#4

Only?

It’s not like php versions change every 2 weeks like firefox versions.

It seems like a better solution is a quarterly calendar item to evaluate what’s happening with php version-wise and what updates/upgrades those changes will entail. then manually upgrading your php version rather than waiting for dreamhost to force the change. That way you can still roll-back if you need to. You got lucky that this time the only thing that broke your site was a missing phprc entry. What if next time your file needs an additional entry?


#5

Maybe I should have used the word “best”, for my situation.

I am not the website owner, they just email me when something breaks. I am trying to future proof it the best I can. They don’t know how to create a phprc file, or what it does. They don’t know how to manually upgrade the PHP version, or if they should.