Skip to content
NewRedesigned blogFeedback
Jigar Karangiya

DDEV Docker: How to change the project PHP version?

Hello Magento Devs, DDEV makes it easier to set up a Docker stack for your PHP developments and it provides great utility in Magento 2 development.

DDEV Docker: How to change the project PHP version?
Written by
JKJigar Karangiya
Published
Reading time
1 min read

Jigar Karangiya · · 1 min read

Hello Magento Devs,

DDEV (opens in new tab) makes it easier to set up a Docker stack for your PHP developments and it provides great utility in Magento 2 development.

Today we are going to see,
How can we change the php version for any project inside the DDEV configuration? By default, DDEV uses 8.1 as per the current date.

We will see how to change and set our preferred php version for our Magento 2 project.

Step 1: Find the DDEV config file of the project

Go to the project root directory and navigate to the .ddev directory.

This is a hidden directory where project-related ddev configuration and other pieces of stuff are stored.

Figure 01

Inside this folder, you will be able to find some .yaml files and other container-related stuff.

Step 2: Update the PHP version in the config.yaml

Open the config.yaml file in your preferred text editor.

You will find the “php_version ” variable changes its value to your preferred PHP version.

Figure 02

Step 3: Restart the project using the DDEV

After changing the PHP version, you will need to restart the web container to make changes affect.

You can do this quickly and easily using restarting DDEV with the below command.

RunTerminal
ddev restart

Step 4: Check the current PHP version

After restarting the ddev containers you can now see the latest PHP version in your project configuration.

You can check this using the below command.

RunTerminal
ddev describe
Figure 03

That’s it, I hope you find this blog useful.

Let me know if you have any queries in the comment box, see you soon in the next blog.

Keep Coding !!!

Keep reading
All posts

01 · 10 min · Shares Adobe Commerce Core

Adobe Commerce Agentic Capabilities, Q4 2026

Five agentic releases for Adobe Commerce: LLM product discovery, Brand Visibility, the Shopper MCP server, Brand Concierge, and Experience Workspace. What each one does, which editions get it, and when.

10 min

03 · 3 min · Shares Adobe Commerce Core

Conditions for Collections in Magento 2

Collections in Magento 2 (Now Adobe Commerce), are among the most powerful tools for retrieving and manipulating data directly from the database.

3 min

Newsletter

New Magento tutorials, straight to your inbox

Code examples, performance tips, and fixes for common Magento issues. No spam.

Subscribe