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
Copy file name to clipboardExpand all lines: README.md
+24-3Lines changed: 24 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -123,13 +123,34 @@ section of composer.json:
123
123
124
124
### How do I specify a PHP version?
125
125
126
-
This project supports PHP 8.3 as minimum version (see [PHP requirements](https://www.drupal.org/docs/system-requirements/php-requirements)), however it's possible that a `composer update` will upgrade some package that will then require PHP 8.3+.
126
+
There are 2 places where Composer will be looking for PHP version requirements
127
+
when resolving dependencies:
128
+
1. The `require.php` version value in `composer.json`.
129
+
2. The `config.platform` version value in `composer.json`.
127
130
128
-
To prevent this you can add this code to specify the PHP version you want to use in the `config` section of `composer.json`:
131
+
The purpose of `require.php` is to set the minimum PHP language requirements
132
+
for a package. For example, the minimum version required for Drupal 11.0 is
133
+
`8.3` or above, which can be specified as `>=8.3`.
134
+
135
+
The purpose of `config.platform` is to set the PHP language requirements for the
136
+
specific instance of the package running in the current environment. For
137
+
example, while the minimum version required for Drupal 11 is `8.3` or above,
138
+
the actual PHP version on the hosting provider could be `8.3.1`. The value of
139
+
this field should provide your exact version of PHP with all 3 parts of the
140
+
version.
141
+
142
+
#### Which versions to specify in my Drupal site?
143
+
144
+
This project includes `drupal/core` which already has `require.php` added. Your
145
+
would inherit that constraint. There is no need to add `require.php` to your
146
+
`composer.json`.
147
+
148
+
`config.platform` is a platform-specific. It is recommended to specify
149
+
`config.platform` as a _specific version_ (e.g.`8.3.1`) constraint to ensure
150
+
that only the package versions supported by your current environment are used.
0 commit comments