全球主机交流论坛

标题: 如何cli用php执行php文件? [打印本页]

作者: 九进制少年    时间: 2014-1-12 09:07
标题: 如何cli用php执行php文件?
如我的文件是 /root/php.php ,如何cli用php执行它?
作者: 单手摘月    时间: 2014-1-12 09:09
提示: 作者被禁止或删除 内容自动屏蔽
作者: 九进制少年    时间: 2014-1-12 09:12
单手摘月 发表于 2014-1-12 09:09
直接這樣就行啊

我就是这样试了,但是提示我
  1. -bash: php: command not found
复制代码

作者: 单手摘月    时间: 2014-1-12 09:16
提示: 作者被禁止或删除 内容自动屏蔽
作者: 九进制少年    时间: 2014-1-12 09:21
本帖最后由 九进制少年 于 2014-1-12 09:23 编辑
单手摘月 发表于 2014-1-12 09:16
apt-get install php5-cli

yum install php-cli


执行了 yum , apt-get 也提示
  1. -bash: apt-get: command not found
复制代码


然后安装报错
  1. Error: Package: php-cli-5.3.3-27.el6_5.x86_64 (updates)
  2.            Requires: php-common(x86-64) = 5.3.3-27.el6_5
  3.            Installed: php-common-5.4.24-1.el6.remi.x86_64 (@remi)
  4.                php-common(x86-64) = 5.4.24-1.el6.remi
  5.            Available: php-common-5.3.3-26.el6.x86_64 (base)
  6.                php-common(x86-64) = 5.3.3-26.el6
  7.            Available: php-common-5.3.3-27.el6_5.x86_64 (updates)
  8.                php-common(x86-64) = 5.3.3-27.el6_5
  9. You could try using --skip-broken to work around the problem
  10. You could try running: rpm -Va --nofiles --nodigest
  11. [root@localhost ~]#     php /root/php.php
  12. -bash: php: command not found
复制代码

作者: Ruclinux    时间: 2014-1-12 09:28
九进制少年 发表于 2014-1-12 09:21
执行了 yum , apt-get 也提示

然后安装报错

哥,试下
#yum install php* -y

作者: 单手摘月    时间: 2014-1-12 09:45
提示: 作者被禁止或删除 内容自动屏蔽




欢迎光临 全球主机交流论坛 (https://ddzzz.eu.org/) Powered by Discuz! X3.4