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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to use php-cli 7.X instead 5.6

Discussion in 'EasyApache' started by speckados, Jun 5, 2017.

Tags:
  1. speckados

    speckados Well-Known Member

    Joined:
    May 21, 2003
    Messages:
    305
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Acequias :: Granada :: España
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Hi.

    I need use for Laravel and Symfony projects, use php-cli or php on command line but version 7 or 7.1

    Site has 7.0 with FPM and not problem. But on command line we need also use php 7.X

    Code:
    [excelle@srv105 ~]$ php -v
    ea-php-cli Copyright 2016 cPanel, Inc.
    PHP 5.6.30 (cli) (built: May 17 2017 20:27:43)
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
        with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v5.1.1, Copyright (c) 2002-2016, by ionCube Ltd.
        with Zend Guard Loader v3.3, Copyright (c) 1998-2014, by Zend Technologies
        with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies
    It's possible?


    Also, i don't understand the strange behavior of php.ini.

    Well, on shell

    Code:
    php --info | grep allow_url_fopen
    allow_url_fopen => Off => Off
    [excelle@srv105 ~]$ php --info | grep php.ini
    Configuration File (php.ini) Path => /opt/cpanel/ea-php56/root/etc
    Loaded Configuration File => /opt/cpanel/ea-php56/root/etc/php.ini
    Edit /opt/cpanel/ea-php56/root/etc/php.ini for put allow_url_fopen = On
    But after run info for get value of allow_url_open value is still off

    Try edit also on WHM, but not work.
     
    #1 speckados, Jun 5, 2017
    Last edited: Jun 5, 2017
  2. Anoop P Alias

    Anoop P Alias Well-Known Member

    Joined:
    Mar 31, 2015
    Messages:
    76
    Likes Received:
    10
    Trophy Points:
    8
    Location:
    Kochi,Kerala,India
    cPanel Access Level:
    Root Administrator
    Issue #1 - Please use full path to php-cli
    For example : /opt/cpanel/ea-php71/root/usr/bin/php

    Issue #2 - If you edit from WHM it should work!
    Note that cPanel (at least for now includes a file /opt/cpanel/ea-php71/root/etc/php.d/local.ini which is an exact replica of the original php.ini and therefore overrides most of the options in php.ini. Editing from WHM edits local.ini instead of php.ini
    Also note that php-fpm would need a restart if you change any options in php.ini
     
  3. speckados

    speckados Well-Known Member

    Joined:
    May 21, 2003
    Messages:
    305
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Acequias :: Granada :: España
    cPanel Access Level:
    DataCenter Provider
    Twitter:
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The PHP binary finds the version specified for the directory you are currently in (not the directory the file exists in). If you do not run the command from the document root for the domain (where .user.ini and php.ini exist) it will use the system default version.

    Thank you.
     
Loading...

Share This Page