search
Homephp教程php手册php cli sapi执行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?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代码了

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version