全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 3722|回复: 6

如何cli用php执行php文件?

[复制链接]
发表于 2014-1-12 09:07:20 | 显示全部楼层 |阅读模式
如我的文件是 /root/php.php ,如何cli用php执行它?
发表于 2014-1-12 09:09:56 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
 楼主| 发表于 2014-1-12 09:12:23 | 显示全部楼层

我就是这样试了,但是提示我
  1. -bash: php: command not found
复制代码
发表于 2014-1-12 09:16:45 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
 楼主| 发表于 2014-1-12 09:21:50 | 显示全部楼层
本帖最后由 九进制少年 于 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
复制代码
发表于 2014-1-12 09:28:33 | 显示全部楼层
九进制少年 发表于 2014-1-12 09:21
执行了 yum , apt-get 也提示

然后安装报错

哥,试下
#yum install php* -y
发表于 2014-1-12 09:45:57 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-5-6 05:24 , Processed in 0.062937 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表