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
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
If I run sudo yum install php-cli it returns
If I run rpm -q php-cli i get
If I run php -a i get an Interactive Shell with a php > prompt
I have a php file i am testing which results in Not Running from CLI. The php script is:
What am I missing here? I can't seem to figure out how to get CLI to work. Thanks for the help.
Code:
[~]# sudo find / -name php-cli
/home/virtfs/usrone/usr/bin/php-cli
/usr/bin/php-cli
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.
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
Code:
root[~]# rpm -q php-cli
package php-cli is not installed
Code:
root[~]# php -a
Interactive shell
php >
Code:
<?php
if(php_sapi_name()==="cli")
echo("Running from CLI");
else
echo("Not Running from CLI");