Knowledgebase

Plesk is not accessible: PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.4.0".

Which response do you prefer?
Response 1

The error message you provided indicates that there is a version mismatch between the PHP version required by your Composer dependencies and the currently installed PHP version on your server.

Here's what you can do to resolve this issue:

  1. Upgrade PHP Version:

    • Upgrade your server's PHP version to meet the requirements of your Composer dependencies (in this case, ">= 7.4.0"). You can do this via Plesk or through the command line, depending on your server's configuration.
  2. Check PHP Versions in Plesk:

    • In Plesk, go to "Tools & Settings" > "PHP Settings" and ensure that PHP 7.4 or a higher version is available and selected.
  3. Update Composer Dependencies:

    • If your project relies on specific Composer dependencies, make sure that you update your composer.json file to specify the required PHP version correctly.

    Example composer.json snippet:

    JSON
    "require": { "php": ">=7.4.0", // ... }
  4. Update Composer:

    • Run composer self-update to ensure you have the latest version of Composer installed.
  5. Update Dependencies:

    • After adjusting your composer.json file, run composer update to update your project's dependencies to versions that are compatible with PHP 7.4 or higher.
  6. Check for PHP Extensions:

    • Verify that all the necessary PHP extensions required by your project are installed and enabled for the selected PHP version.
  7. Restart Web Server:

    • After making any changes to PHP or Composer, it's a good practice to restart your web server to ensure the changes take effect.
  8. Check Logs for Details:

    • If the issue persists, review your server's error logs (e.g., Apache or Nginx logs) for any additional error messages or warnings.
  9. Contact Support:

    • If you're still experiencing issues, consider reaching out to Plesk support or the support channels of the specific software or dependencies you're working with. They might have specific recommendations based on your configuration.

Remember to always create backups of your projects and configurations before making significant changes, especially when adjusting PHP versions and dependencies.

Response 2

The error message you're encountering, "Composer detected issues in your platform: Your Composer dependencies require a PHP version '>= 7.4.0'," indicates that the PHP version installed on your server is older than the version required by your Composer dependencies.

To resolve this issue and make Plesk accessible, you'll need to upgrade your server's PHP version to meet the minimum requirements of your Composer dependencies (in this case, PHP >= 7.4.0). Here are the steps to do that:

Note: These instructions may vary depending on your server's operating system and package manager (e.g., yum, apt). Ensure you have administrative privileges (root or sudo) to perform these actions.

  1. Check Current PHP Version:

    • First, confirm the currently installed PHP version by running the following command:
      php -v
  2. Add Repository (if necessary):

    • If your server's PHP version is older than 7.4, you may need to add a repository that provides a newer PHP version. This step varies depending on your server's OS.
  3. Upgrade PHP:

    • Upgrade PHP to a version that is equal to or greater than 7.4. The exact command may depend on your server's OS and package manager:

    • For Ubuntu/Debian:

      bash
      sudo apt-get update sudo apt-get install php7.4
    • For CentOS/Red Hat:

      bash
      sudo yum install epel-release sudo yum install php74
    • Adjust the PHP version and package name as needed based on the available packages for your OS.

  4. Enable PHP 7.4 in Plesk:

    • After installing the required PHP version, you'll need to enable it in Plesk. Log in to your Plesk interface and navigate to "Tools & Settings" > "PHP Settings." There, select PHP 7.4 (or the version you installed) as the active PHP version for your domains.
  5. Test Plesk Accessibility:

    • After upgrading PHP and enabling the new version in Plesk, test the accessibility of your Plesk control panel. You should now be able to access Plesk without encountering the PHP fatal error.
  6. Update Composer Dependencies (if needed):

    • If you have projects or applications within Plesk that rely on Composer, you may also need to update their dependencies to be compatible with the new PHP version. Navigate to the project's directory and run composer update to ensure all dependencies are compatible with PHP 7.4.

By upgrading PHP to a version that meets the requirements of your Composer dependencies, you should resolve the PHP fatal error and regain access to Plesk. Always make sure to back up your server and data before performing major updates or changes.

  • 0 Users Found This Useful
Was this answer helpful?