Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Setting PHP version for subdomain issue

Discussion in 'EasyApache' started by Karthikeyan18, Jun 29, 2018.

  1. Karthikeyan18

    Karthikeyan18 Member

    Joined:
    Jun 29, 2018
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    coimbatore
    cPanel Access Level:
    Root Administrator
    I am using cent os 6.9 in VPS server and having the root administrator access.I stored all my applications in /home/(cpanel-name)public_html folder.I have already set the default System php version as 7.1 in WHM.
    But when creating the new sub domain into the public_html folder it sets the php version as 5.6.So i unable to run composer in my Default php version.
     
  2. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,551
    Likes Received:
    253
    Trophy Points:
    193
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Karthikeyan18

    Karthikeyan18 Member

    Joined:
    Jun 29, 2018
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    coimbatore
    cPanel Access Level:
    Root Administrator
    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.
     
  4. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,551
    Likes Received:
    253
    Trophy Points:
    193
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    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:

    Code:
    [root@server bin]# cat /home/example/public_html/phpinfo.php
    <?php
    
    phpinfo();
    
    ?>
    Then you can view it by going to http://yourdomain.tld/phpinfo.php

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Karthikeyan18

    Karthikeyan18 Member

    Joined:
    Jun 29, 2018
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    coimbatore
    cPanel Access Level:
    Root Administrator
    Hi Lauren,

    It show the php version 7.1.19.

    Thanks
     
  6. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,551
    Likes Received:
    253
    Trophy Points:
    193
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    HI @Karthikeyan18


    That proves that you're running php 7.1 on that domain. Do you get different output when you run
    Code:
    /usr/bin/php -v
    /bin/php -v
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. Karthikeyan18

    Karthikeyan18 Member

    Joined:
    Jun 29, 2018
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    coimbatore
    cPanel Access Level:
    Root Administrator
    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?
     
  8. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,551
    Likes Received:
    253
    Trophy Points:
    193
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    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
    Code:
    /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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice