Table of contents
It is possible to update the site configuration of your Pantheon Drupal environment to adjust server side settings such as the version of PHP your site is running on, as well as other settings such as the version of MariaDB.
In this article we will cover how to change the PHP version, but the procedure is the same for any value applicable to the pantheon.yml file.
Before you begin
This procedure requires a local copy of your site's Git repository. If you have not previously downloaded your site's code, or need help setting up Git, follow the setup and Site code checkout instructions in Drupal on Pantheon (Build a site with Composer).
If you already have a local copy of the site's repository, open a terminal, change to the site's repository directory, and retrieve the latest changes:
git status
git pull
Finding pantheon.yml
Pantheon system settings for the site are stored in a file named pantheon.yml. The file is located in the root of the site's repository.
“Root” means the top level of the site's code directory, rather than a directory inside it.
Open the site's repository directory and locate:
pantheon.yml
Changing Settings
Once you find or create the pantheon.yml file, edit it with a text editor. For this article we will be editing the value of PHP, so search your file for PHP. If your file has a PHP value you can edit it, if it does not you can add one. For this example we will change the PHP setting to use PHP version 8.3 by editing or adding the following value on its own line:
php_version: 8.3
Once you have added or edited the value, save the file.
Commit and push
After editing the pantheon.yml file, you are now ready to commit your changes to the site repo and push them back to the Pantheon server to be build. From your git repo on the command line, or from your git GUI, you should see that the pantheon.yml file has changed.
- Adding your changes with "
git add file_name" or "git add ."
- "git add ." adds all changes made at once
- Commit the changes with
git commit -m "your message here", and give the commit a message describing what changes were done between the "".
- the -m command is for leaving the commit message
- Once you have committed them, you can push your changes to Pantheon with
git push.
Once you push your changes, Pantheon will run updates on their servers, and the changes will be deployed to the dev version of your site for review. Once you have tested the changes on the dev site, you will then need to push the code changes up to test and then again to the live site. Instructions for this are included in the Drupal on Pantheon (Build a site with Composer) article.
Other values
It is possible to adjust other values, such as the version of MariaDB database that your drupal site is using, by editing the pantheon.yml file as above. For example, to edit the version of Maria, you would find and edit or add the lines:
database:
version: 10.6
For the full list of values or to view the Pantheon documentation, please review the resources below.