Home > Article > Backend Development > PHP command line mode under linux
Masters, there is an index.php file in the root directory of the website. The content can be output normally when accessed through a browser, but when I execute php index.php in the Linux system, it cannot be explained. Is my method wrong? What should I do?
<code>PHP安装目录/bin/php -v PHP安装目录/bin/php-cgi -v # 可以看到PHP版本信息的话,则执行: export PATH=$PATH:PHP安装目录/php/bin</code>Can’t see the information, go and install PHP related packages
<code>sudo apt-get install php5-cli sudo apt-get install php7.0-cli</code>
Several SAPI corresponding packages for PHP:
<code>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)</code>