84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
大神们,在网站的根目录有个index.php文件,通过浏览器访问是可以正常输出内容的,但我在Linux系统中执行php index.php 无法解释。是不是我的方法错了,那我要怎么做
业精于勤,荒于嬉;行成于思,毁于随。
PHP安装目录/bin/php -v PHP安装目录/bin/php-cgi -v # 可以看到PHP版本信息的话,则执行: export PATH=$PATH:PHP安装目录/php/bin
看不到信息,去安装PHP相关包
需要先安装php命令行解释器,比如Ubuntu/Debian可以这样:
sudo apt-get install php5-cli sudo apt-get install php7.0-cli
PHP几个SAPI对应的包:
apt-cache search php7.0 php7.0-cli - command-line interpreter for the PHP scripting language php7.0-cgi - server-side, HTML-embedded scripting language (CGI binary) php7.0-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary) libapache2-mod-php7.0 - server-side, HTML-embedded scripting language (Apache 2 module)
看不到信息,去安装PHP相关包
需要先安装php命令行解释器,比如Ubuntu/Debian可以这样:
PHP几个SAPI对应的包: