2

I've currently installed CentOS (6.5 version), nginx, mysql and php. I've tried to navigate to index.php in a browser, and it looks fine, but if I try to run the script via the command-line I get:

php: command not found

Why did that happen? How can I solve it?


Edit: I tried to install the php-cli package:

# yum install php-cli
Error: Package: php-cli-5.3.3-40.el6_6.x86_64 (updates)Requires: php-common(x86-64) = 5.3.3-40.el6_6
           Installed: php-common-5.4.35-1.el6.remi.x86_64 (@remi)
               php-common(x86-64) = 5.4.35-1.el6.remi
           Available: php-common-5.3.3-38.el6.x86_64 (base)
               php-common(x86-64) = 5.3.3-38.el6
           Available: php-common-5.3.3-40.el6_6.x86_64 (updates)
               php-common(x86-64) = 5.3.3-40.el6_6
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

1 Answer 1

2

You have to install the commandline interface version of php before you can use it from bash:

yum install php-cli

the commandline version is not necessary if PHP is part of a page in nginx.

1
  • 1
    See edited post Commented Dec 8, 2014 at 19:42

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.