How to update the PHP version in the Shopware docker installation.

Custom developmentCustom web applicationMobile App
How to update the PHP version in the Shopware docker installation.

The default PHP version in the docker Shopware installation is PHP 7.4. If you want to update the PHP version to 8 and above, please follow the following instructions.

 

 

Step 1: Update .psh.yaml.dist file

Please find the `.psh.yaml.dist` file in the root folder. Inside the file there is a variable `DOCKER_IMAGE_PHP_VERSION`, currently the variable value is 7.4, you have to change this value to 8.1

 

Step 2: Update composer.json file 

Please open the composer.json file in the root folder, and find the PHP version in `config.platform.php`, you have to change this value also to 8.1. and also change the `require.php` to 8.1.

If you want to update the Shopware to a specific version you have to change `require.shopware/platform` to “6.4.17.1” (Please change the version depending on your requirement).

 

Step 3: Update Dockerfile file

Open the dev-ops/docker/containers/app/Dockerfile and search for IMAGE_PHP_VERSION and change the value to 8.1

Step 4: Update docker-compose.yml file

 

In the next step, we have to update the docker-compose.yml file. here we have to update the docker image

Change the image under `services.app_server` to `shopware/development:8.1-composer-2`

Step 5: Restart docker

 

After all the above steps, please restart your docker. First, you have to stop all containers and then start the containers.

./psh.phar docker:stop
./psh.phar docker:startcode here

 

Now the PHP version is updated 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

3 × four =

2hats Logic HelpBot