After changing PHP to 8.1 for a domain it still shows as 8.0
The server has PHP 8.0 and 8.1 installed, but using MultiPHP Manager to set the PHP version to 8.1 does not seem to work. Subsequently running php --version in a shell for that domain gives "8.0.28".
From the WHM terminal I get "8.1.17".
The domain needs 8.1 for a Laravel 10 app, so how can I fix this?
-
Running php --version using CLI will always use the version of PHP that's defined as default. What you could do is create a file called "info.php" with the following contents in the website directory: ``` -1 -
Thanks for your helpful response. I changed the default to 8.1, as I had to run composer update from a CLI, and that solved the problem. The website was already running 8.1, as you said. 0 -
If you're trying to run a specific PHP version from CLI, you could just use the full path to the PHP executable: - /usr/local/bin/ea-php81
- /usr/local/bin/ea-php80
- /usr/local/bin/ea-php74
- ...
- ...
0 -
Thanks for the tip. It would be less confusing if cPanel changed this comment on the WHM/MultiPHP Manager page: This setting applies to new account creations and domains set to inherit the System PHP Version. to something like this: This setting applies to new account creations and domains set to inherit the System PHP Version, and to all CLI shells. 0 -
@Flyer - that's a good idea. I created an improvement case with our developers to see if they can update that wording! 0
Please sign in to leave a comment.
Comments
5 comments