'Magento 2 website with multiple errors (HTTP Error 500, PHP Warning, among others) can't make it work again

we currently have a locally hosted Magento test site and some time ago it was working OK but after doing some changes it stopped working and constantly shows HTTP Error 500. I am new to Magento and to Linux (we use here a Gentoo Linux machine) and I tried to research as much as I can, testing different solutions, but the problem persists and I have the idea that is getting worse every time I try to resolve something.

The problem I am having now inside the Terminal is a PHP Warning and PHP Fatal Error related to the 'require' function. Every time I try to do something about Magento I have this error (for example, if I run 'php bin/magento --version' I have this error, and so on with every command related with Magento). As far as I understand, this problem occurs when you try to call for a file that doesn't exists or is not there. In my case trouble seems to be related with the Sage Pay extension. This is the warning I have inside Terminal:

PHP Warning:  require(/var/www/localhost/htdocs/vendor/composer/../ebizmarts/sagepaysuite/registration.php): failed to open stream: No such file or directory in /var/www/localhost/htdocs/vendor/composer/autoload_real.php on line 73
PHP Fatal error:  require(): Failed opening required '/var/www/localhost/htdocs/vendor/composer/../ebizmarts/sagepaysuite/registration.php' (include_path='/var/www/localhost/htdocs/vendor/magento/zendframework1/library:.:/usr/share/php7:/usr/share/php') in /var/www/localhost/htdocs/vendor/composer/autoload_real.php on line 73

Thinking that this could be related to the extension itself being missing for some reason, when I try to install the extension I have this error:

    Installation failed, reverting ./composer.json to its original content.
    
    [RuntimeException]                                                           
  Failed to execute git clone --no-checkout -- 'https://MHuYqyU63hS4dojaex1J:  
  ***@gitlab.ebizmarts.com/ebizmarts/magento2-sage-pay-suite.git' '/var/www/l  
  ocalhost/htdocs/vendor/ebizmarts/sagepaysuite' && cd '/var/www/localhost/ht  
  docs/vendor/ebizmarts/sagepaysuite' && git remote add composer -- 'https://  
  MHuYqyU63hS4dojaex1J:***@gitlab.ebizmarts.com/ebizmarts/magento2-sage-pay-s  
  uite.git' && git fetch composer && git remote set-url origin -- 'https://gi  
  tlab.ebizmarts.com/ebizmarts/magento2-sage-pay-suite.git' && git remote set  
  -url composer -- 'https://gitlab.ebizmarts.com/ebizmarts/magento2-sage-pay-  
  suite.git'                                                                   
                                                                               
  Cloning into '/var/www/localhost/htdocs/vendor/ebizmarts/sagepaysuite'...    
  remote: HTTP Basic: Access denied                                            
  fatal: Authentication failed for 'https://gitlab.ebizmarts.com/ebizmarts/ma  
  gento2-sage-pay-suite.git/'

Similarly, when I try to update Composer I have the same error related to Sage Pay and the update is aborted.

Our current composer.json file is as follows:

{
    "name": "magento/project-community-edition",
    "description": "eCommerce Platform for Growth (Community Edition)",
    "type": "project",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "config": {
        "preferred-install": "dist",
        "sort-packages": true
    },
    "require": {
        "absolute_design/absolute-slider": "^2.0.0",
        "bitware/speedenginedeferjs": "^1.0",
        "ebizmarts/sagepaysuite": "~1.3",
        "magefan/module-wysiwyg-advanced": "^2.0",
        "magento/data-migration-tool": "~2.3",
        "magento/product-community-edition": "~2.3.7-p1",
        "mageplaza/magento-2-english-united-kingdom-language-pack": "dev-master",
        "mageplaza/magento-2-seo-extension": "^2.1",
        "mageplaza/module-ajax-layered-navigation": "^1.0",
        "mageplaza/module-delete-orders": "^1.2",
        "mageplaza/module-gdpr": "^1.2",
        "mageplaza/module-sitemap": "^1.0",
        "olegkoval/magento2-regenerate-url-rewrites": "^1.5",
        "trustpilot/module-reviews": "^2.6"
    },
    "require-dev": {
        "allure-framework/allure-phpunit": "~1.2.0",
        "friendsofphp/php-cs-fixer": "~2.14.0",
        "lusitanian/oauth": "~0.8.10",
        "magento/magento-coding-standard": "~3.0.0",
        "magento/magento2-functional-testing-framework": "2.4.5",
        "pdepend/pdepend": "2.5.2",
        "phpmd/phpmd": "@stable",
        "phpunit/phpunit": "~6.5.0",
        "sebastian/phpcpd": "~3.0.0",
        "squizlabs/php_codesniffer": "~3.4.0"
    },
    "conflict": {
        "gene/bluefoot": "*"
    },
    "autoload": {
        "psr-4": {
            "Magento\\Framework\\": "lib/internal/Magento/Framework/",
            "Magento\\Setup\\": "setup/src/Magento/Setup/",
            "Magento\\": "app/code/Magento/",
            "Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"
        },
        "psr-0": {
            "": [
                "app/code/",
                "generated/code/"
            ]
        },
        "files": [
            "app/etc/NonComposerComponentRegistration.php"
        ],
        "exclude-from-classmap": [
            "**/dev/**",
            "**/update/**",
            "**/Test/**"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
            "Magento\\Tools\\": "dev/tools/Magento/Tools/",
            "Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
            "Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
            "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
        }
    },
    "version": "2.3.0",
    "minimum-stability": "stable",
    "repositories": {
        "0": {
            "type": "composer",
            "url": "https://repo.magento.com/"
        },
        "magento": {
            "type": "composer",
            "url": "https://repo.magento.com"
        },
        "ebizmarts": {
            "type": "composer",
            "url": "https://packages.ebizmarts.com"
        }
    },
    "extra": {
        "magento-force": "override"
    }
}

Any help would be appreciated, I am very lost and stuck right now not knowing how to resolve this.

Thanks in advance.



Solution 1:[1]

Maybe issue from extension ebizmarts/sagepaysuite you can check file composer.json in this extension. In file composer.json you can see lable "require" php version for this extension.

=> you can delete this extension or upgrade you php version.

have a nice day !

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1