Skip to main content

As outlined in an earlier article composer php version, when installing the latest version of Drupal the Plesk version and the server version can be different.  In plesk, the version of PHP is 7.3.18, whereas, on the Centos server a check through Terminal (php -v) shows PHP 7.1.33 (cli).

When attempting to install Drupal 9 through composer, the following errors will be shown:

Problem 1
    - drupal/core-composer-scaffold 9.1.x-dev requires php >=7.3.0 -> your PHP version (7.1.33) does not satisfy that requirement.
    - drupal/core-composer-scaffold 9.0.x-dev requires php >=7.3.0 -> your PHP version (7.1.33) does not satisfy that requirement.
    - drupal/core-composer-scaffold 9.0.0-rc1 requires php >=7.3.0 -> your PHP version (7.1.33) does not satisfy that requirement.
    - drupal/core-composer-scaffold 9.0.0-beta3 requires php >=7.3.0 -> your PHP version (7.1.33) does not satisfy that requirement.
    - drupal/core-composer-scaffold 9.0.0-beta2 requires php >=7.3.0 -> your PHP version (7.1.33) does not satisfy that requirement.
    - drupal/core-composer-scaffold 9.0.0-beta1 requires php >=7.3.0 -> your PHP version (7.1.33) does not satisfy that requirement.
    - drupal/core-composer-scaffold 9.0.0-alpha2 requires php >=7.3.0 -> your PHP version (7.1.33) does not satisfy that requirement.
    - drupal/core-composer-scaffold 9.0.0-alpha1 requires php >=7.3.0 -> your PHP version (7.1.33) does not satisfy that requirement.
    - drupal/core-composer-scaffold 9.0.0 requires php >=7.3.0 -> your PHP version (7.1.33) does not satisfy that requirement.
    - Installation request for drupal/core-composer-scaffold ^9 -> satisfiable by drupal/core-composer-scaffold[9.0.0, 9.0.0-alpha1, 9.0.0-alpha2, 9.0.0-beta1, 9.0.0-beta2, 9.0.0-beta3, 9.0.0-rc1, 9.0.x-dev, 9.1.x-dev].

As per the earlier article, you will need to run the following command in Terminal or your shell interface:

export PATH=/opt/plesk/php/7.3/bin:$PATH;

If required you might need to run a httpd restart

CentOS 6

service httpd restart

CentOS 7

sudo systemctl restart httpd.service

While you are toying with the idea of upgrading to Drupal 9... also check the following conditions to install / upgrade:

  • PHP version should be at least 7.3.0
  • When using Apache, minimum version is 2.4.7
  • When using Drush, minimum version is 10

 

More handy commands with Systemctl

To start the Apache service:

sudo systemctl start httpd.service

Stop the Apache service with:

sudo systemctl stop httpd.service

Force Apache to refresh the configuration files:

sudo systemctl reload httpd.service

Set Apache to run when the system boots:

sudo systemctl enable httpd.service

Prevent Apache from loading when the system boots:

sudo systemctl disable httpd.service

 

Note: the reload command is faster and creates much less disruption than restart.  However, this only performs a soft refresh of the configuration files.  Some services and dependencies may not be included in the refresh.  A good practice is to consider the benefits and liabilities of each process.  If you have several clients depending on access to your server, it might be more beneficial to refresh first.  If that fails or if the disruption is minimal then use restart.

Related articles

Andrew Fletcher04 Apr 2025
Managing .gitignore changes
When working with Git, the .gitignore file plays a critical role in controlling which files and folders are tracked by version control. Yet, many developers are unsure when changes to .gitignore take effect and how to manage files that are already being tracked. This uncertainty can lead to...
Andrew Fletcher26 Mar 2025
How to fix the ‘Undefined function t’ error in Drupal 10 or 11 code
Upgrading to Drupal 10.4+ you might have noticed a warning in their code editor stating “Undefined function ‘t’”. While Drupal’s `t()` function remains valid in procedural code, some language analysis tools — such as Intelephense — do not automatically recognise Drupal’s global functions. This...
Andrew Fletcher17 Mar 2025
Upgrading to PHP 8.4 challenges with Drupal contrib modules
The upgrade from PHP 8.3.14 to PHP 8.4.4 presents challenges for Drupal 10.4 websites, particularly when dealing with contributed modules. While Drupal core operates seamlessly, various contrib modules have not yet been updated to accommodate changes introduced in PHP 8.4.x. This has resulted in...