You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Very often, there is a need to change the patch version of PHP installed. For example, my team's policy is that we support at least PHP 7.0.33 (latest patch), and therefore the development environment must be at that version.
A. Update OS Package
One way of doing this is described here. Basically, after logging into your environment (vagrant ssh), you find out what PHP versions are available to you:
If you have very specific requirements, especially if you need PHP compiled in a certain way, one good solution is using phpbrew. This will allow you to build any PHP version. Be aware, however, that since you are building PHP in your dev environment, that environment will need to contain build requirements, which are very often devel-level packages. There is no definitive list of packages you need, because build requirements for each specific PHP version is different. You can find an example of doing this here.
Install build requirements. These are the different OS packages that are needed to build my specific version, which in that example is PHP 5.5.10.
Install phpbrew. Pretty straight-forward sequence according to the manual, which will result in it having an up-to-date version of recipes.
Compile PHP. Creates a new version available to PHPBrew with specific extensions, and also adds code to the startup script. This helps with running phpbrew in the future.
Very often, there is a need to change the patch version of PHP installed. For example, my team's policy is that we support at least PHP 7.0.33 (latest patch), and therefore the development environment must be at that version.
A. Update OS Package
One way of doing this is described here. Basically, after logging into your environment (
vagrant ssh
), you find out what PHP versions are available to you:sudo apt show -a php7.0 | grep Version
This will produce output, e.g.
Once you know this, you can install a specific version:
B. Build for Specific Requirements
If you have very specific requirements, especially if you need PHP compiled in a certain way, one good solution is using
phpbrew
. This will allow you to build any PHP version. Be aware, however, that since you are building PHP in your dev environment, that environment will need to contain build requirements, which are very oftendevel
-level packages. There is no definitive list of packages you need, because build requirements for each specific PHP version is different. You can find an example of doing this here.phpbrew
. Pretty straight-forward sequence according to the manual, which will result in it having an up-to-date version of recipes.phpbrew
in the future.Another similar approach is by using
phpenv
, which is gaining popularity.The text was updated successfully, but these errors were encountered: