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.

PHP CLI Not Running but Installed...Sort of

Discussion in 'EasyApache' started by MojoCreations, Sep 24, 2014.

  1. MojoCreations

    MojoCreations Active Member

    Joined:
    Feb 14, 2012
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I am trying to get PHP CLI to work and it is not working for me at all. When I run sudo find I get

    Code:
    [~]# sudo find / -name php-cli
    /home/virtfs/usrone/usr/bin/php-cli
    /usr/bin/php-cli
    
    If I go to the usr directory and edit the php-cli link it shows me, /usr/local/bin/php. Is this correct?

    I run /usr/local/bin/php -v and get the following

    Code:
    root[~]# /usr/local/bin/php -v
    PHP 5.5.17 (cli) (built: Sep 24 2014 11:53:13)
    Copyright (c) 1997-2014 The PHP Group
    Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
        with the ionCube PHP Loader v4.6.1, Copyright (c) 2002-2014, by ionCube Ltd.
    
    If I run sudo yum install php-cli it returns

    Code:
    root [~]# yum install php-cli
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirrordenver.fdcservers.net
     * epel: mirror.compevo.com
     * extras: centos.escapemg.com
     * updates: centosi3.centos.org
     * webtatic: us-east.repo.webtatic.com
    Setting up Install Process
    No package php-cli available.
    Error: Nothing to do
    
    If I run rpm -q php-cli i get

    Code:
    root[~]# rpm -q php-cli
    package php-cli is not installed
    
    If I run php -a i get an Interactive Shell with a php > prompt
    Code:
    root[~]# php -a
    Interactive shell
    php >
    
    I have a php file i am testing which results in Not Running from CLI. The php script is:
    Code:
    <?php
    if(php_sapi_name()==="cli")
      echo("Running from CLI"); 
    else
      echo("Not Running from CLI");
    
    What am I missing here? I can't seem to figure out how to get CLI to work. Thanks for the help.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. MojoCreations

    MojoCreations Active Member

    Joined:
    Feb 14, 2012
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Michael,

    It looks like it is installed but not running or working with the script i used. Did you see the script I ran, it came back that its not working.

    If I go to the usr directory and edit the php-cli link it shows me, /usr/local/bin/php. Is this correct?
     
Loading...

Share This Page