php执行多条shell命令
php下执行shell命令可以用system、exec之类的,但是每个单独的system命令都是分别调用shell的,每次的环境都要重新初始化,因此多条命令连续的操作不能通过多条system实现功能,于是就有两种方法来解决这种问题。
1.用php生成shell文件并执行它,完事后删除file_put_countents('tmp.sh',"cd /usr/local<br>
echo 'string'<br>
ls $callback");<br>
system('tmp.sh');
多条命令 直接换行就可以了
2.多条命令直接写在一条语句里system("cd {$path1};if [ ! -d {$path2} ];then \n { mkdir -p {$path2} \n chmod -R 777 {$path2} \n } \n fi;find -name '{$etaskid}-{$sid}*' -print | while read na
很明显的缺点就是语句过长 不好写
AD:真正免费,域名+虚机+企业邮箱=0元

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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

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

WebStorm Mac version
Useful JavaScript development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment