Skip to main content

Setting PHP version for subdomain issue

Comments

7 comments

  • cPanelLauren
    Hi @Karthikeyan18 If you go to cPanel>>Software>>MultiPHP Manager you should be able to update the php version for any domain in the account there. You should also be able to change this through WHM>>Software>>MultiPHP Manager How are you creating accounts? By default, they should be set to inherit unless you have a custom configuration determining the PHP version or PHP-FPM. Thanks!
    0
  • Karthikeyan18
    Hi Lauren, I already did that WHM multiPHP manager as 7.1 for sub domain i have set.I tried to check the PHP version using php -v command in SSH,it showed as 5.6. My subdomain's application folder exists in this path /home/Username/public_html/.But when i check that creating the another sub domain's folder into /home/Username it shows my default version as 7.1 in ssh.
    0
  • cPanelLauren
    Hi @Karthikeyan18 Can you create a php info page in the subdomain's root directory and let me know what the PHP version shows as in the phpinfo? Mine for example looks like this: [root@server bin]# cat /home/example/public_html/phpinfo.php
    Then you can view it by going to
    0
  • Karthikeyan18
    Hi Lauren, It show the php version 7.1.19. Thanks
    0
  • cPanelLauren
    HI @Karthikeyan18 That proves that you're running php 7.1 on that domain. Do you get different output when you run /usr/bin/php -v /bin/php -v
    0
  • Karthikeyan18
    Hi Lauren, I am getting the following output using the "/usr/bin/php -v", PHP 7.0.30 (cgi-fcgi) (built: Jun 26 2018 20:34:46) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies and "/bin/php -v" shows -bash: /bin/php: No such file or directory I have put this subdomain's directory as subdirectory(eg. /home/username/public_html/(Anothor domain's Projectfiles) with sub domain directory) Will this make problem?.Because i already set the sub domain php version as default 7.0 but when checking in ssh at the subdomain directory path php version shows incorrectly. Otherwise, changing the sub domain directory path will fix this Issue?
    0
  • cPanelLauren
    Hi @Karthikeyan18 There is some strangeness occurring with the PHP versions - if you set 7.1 as the default it shouldn't be returning as 7.0 when running /usr/bin/php -v
    Can you please open a ticket for this using the link in my signature? Once opened please update this thread with the Ticket ID so we can follow up here on the outcome of the ticket. Thanks!
    0

Please sign in to leave a comment.