Home » Php » cpanel – How to solve PHP automatic downgrade problem in Server?

cpanel – How to solve PHP automatic downgrade problem in Server?

Posted by: admin February 25, 2020 Leave a comment

Questions:

To host the latest Laravel (6.x) based application I contact my hosting provider to upgrade my site PHP version to PHP 7.3.x and they did it. Then I start facing the following problems:

  1. Initially I upload a fresh Laravel 6.x application in public_html without configuring index.php, as it does not found autoload.php and app.php so it shows the relevant error, but the strange thing is the server’s PHP version automatically downgrade to PHP 5.6.x. Again my hosting provider upgrades to PHP 7.3.x and the application run perfectly.

  2. Then I move all the content except public folder content outside public_html and forgot to do the required changes on index.php, again when I run the application it shows the autoload.php and app.php not found related error and again the server PHP down to 5.6.x. Again my hosting provider upgrades to PHP 7.3.x and the application run perfectly.

  3. After a few hours later I upload another version of the application having the Authentication only (upload only public folder content, but have some changes on node_modules, vendor and etc, but didn’t upload those). This time the server down to PHP 5.4.x 🙂

This is quite confusing for me as I have no idea what actually going on!! Does anyone face the same problem before? Does anyone have any solution to this problem?

N.B: I didn’t see the PHP 7.3.x in Software > PHP Selector from Cpanel.
– Thanks

How to&Answers: