1. php -r php codes param1 param2 2. php -f filename.php param1 param2 3. php -a 4.在php文件头部加上php文件的完整路径 如file.php !#/usr/bin/php?phpecho phpinfo(); 然后给file.php添加执行权限 chmod +x file.php ./file.php 就可以执行文件里面的
1. php -r ‘php codes’ param1 param2…
2. php -f filename.php param1 param2…
3. php -a
4.在php文件头部加上php文件的完整路径
如file.php
!#/usr/bin/php <?php echo phpinfo();
然后给file.php添加执行权限 chmod +x file.php
./file.php 就可以执行文件里面的php代码了
原文地址:php cli sapi执行php代码的几种方式, 感谢原作者分享。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Chinese version
Chinese version, very easy to use

SublimeText3 Linux new version
SublimeText3 Linux latest version
