Install php 5.4

(Rafal Morawiec) #1


Is there a way to install php 5.4 after last update and deprecated homebrew-php ? I know that this version is so old etc but I have couple of project that can’t be upgrade to new php version :frowning:

(Eduard Rozenberg) #2

If 5.6 works for you try brew install php@5.6

If there are additional modules you need that are not built-in to this version, see various posts in this forum regarding installing with pecl or compiling modules from source.

(Rafal Morawiec) #3

I have 5.6 (like 7.0, 7.1 and 7.2) but also I need 5.4

(Sean Molenaar) #4

With the migration to core, all php versions that aren’t supported by the php developers themselves have been dropped. However, you could make your own formula/tap based on the 5.6 formula

(Eduard Rozenberg) #5

Yes, take a look at /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/php@5.6.rb - you can use that as a basis for a 5.4 formula. Won’t be super easy or quick, but is “good learning”. The formula config options should be the same or at least very similar between 5.4 and 5.6.