Skip to main content

MultiPHP Manager set to 8.1.1, and "php -v" gives 8.1.1 in public_html folder, but 5.6.4 in root directory?

Comments

12 comments

  • kodeslogic
    You can refer to the official documentation to know how to set PHP version for a domain [QUOTE]
    0
  • Kadence
    You can refer to the official documentation to know how to set PHP version for a domain

    Thank you. I did set the PHP version to 8.1.1 using cPanel and MultiPHP manager. My issue is that I am getting different versions within the /public_html folder, and above the /public_html folder. If I type "php -v" from somewhere inside the /public_html directory, it says 8.1.1. If I go to the / folder, or to say /var or /public_ftp or /mail, "php -v" gives me 5.6.40. Is this a known issue, or a bug with my installation?
    0
  • ffeingol
    If you are outside the home folder, you're going to get the system default. If you are in a sites home folder then you'll get whatever version of PHP that site is set to.
    0
  • andrew.n
    + you can set different version for Home Directory and for the domain itself.
    0
  • cPanelAnthony
    Hello! If you set up a
    0
  • Kadence
    Hello! If you set up a
    0
  • ffeingol
    Are you physically in the public_html folder or are you supplying the path to the public_html folder. You may also want to search for "run composer with a specific verison of PHP" or something similar. The wrong version of PHP may have been hardcoded in the composer config.
    0
  • Kadence
    Are you physically in the public_html folder or are you supplying the path to the public_html folder. You may also want to search for "run composer with a specific verison of PHP" or something similar. The wrong version of PHP may have been hardcoded in the composer config.

    In Linux, I am in a sub-folder of the /public_html folder when I am calling the composer command. If I call "php -v" from this same location, it gives me 8.1.1. I had kept the main server PHP version to 5.6.4, because I was worried about other sites breaking. But I edited all the other user accounts (other than the account I was talking about in this thread) from inheriting the PHP version, to actively being set to 5.6.4. Then I set the main server PHP version to 8.1.1. This seems to have solved the issue of composer giving a PHP compatibility error. The packages now install properly. Though now I'm getting errors of the following variety, across different libraries: [quote]"Fatal error: Uncaught Error: Class "Symfony\Component\BrowserKit\Client" not found in /home/compareng/public_html/goutte/vendor/fabpot/goutte/Goutte/Client.php:32 Stack trace: #0 {main} thrown in /home/compareng/public_html/goutte/vendor/fabpot/goutte/Goutte/Client.php on line 32" ----- "Fatal error: Uncaught Error: Class "Symfony\Component\BrowserKit\AbstractBrowser" not found in /home/compareng/public_html/panther/vendor/symfony/panther/src/Client.php:55 Stack trace: #0 {main} thrown in /home/compareng/public_html/panther/vendor/symfony/panther/src/Client.php on line 55"
    I think I'll have to try and find assistance from a composer expert on this. Thank you all for the assistance.
    0
  • ffeingol
    This is very generic composer info: How to tell and force Composer to use a specific PHP version such as 7.x or 8.x but it shows how composer can be "hard coded" to a specific PHP version.
    0
  • bouvrie
    + you can set different version for Home Directory and for the domain itself.

    Bumping this post, because I suspect to have the same issue, and there's some miscommunication in this topic. Just to be clear: I think it is NOT possible to set a different version for Home Directory. It is true that MultiPHP INI Editor allows editing the PHP INI settings from:
    • A user's home directory
    • Each of the user's domains' document roots. Each distinct document root can have its own PHP version configured.
    however, the MultiPHP MANAGER on the other hand can only set the PHP version to use for each of the the domains - it can NOT set the PHP version used by a user's home directory. Unless I'm missing something here - is there a way to change the PHP version used by the user's home directory, without changing the global system PHP version? It does not make sense to have a user's domains set to php version A, while the user's shell and cron jobs run php version B...
    0
  • andrew.n
    So if you have several domains and subdomains under the same cPanel account and you go to MultiPHP Manager then you will be able to set a different PHP version for each of them. See
    0

Please sign in to leave a comment.