Greetings! I'm Aneesh Sreedharan, CEO of 2Hats Logic Solutions. At 2Hats Logic Solutions, we are dedicated to providing technical expertise and resolving your concerns in the world of technology. Our blog page serves as a resource where we share insights and experiences, offering valuable perspectives on your queries.
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