当前位置:Gxlcms > PHP教程 > PHP施行linux命令

PHP施行linux命令

时间:2021-07-01 10:21:17 帮助过:15人阅读

PHP 执行linux 命令


# vim /etc/rc.d/rc.local
route add default gw 192.168.0.255 eth0
route add -net 10.0.1.0 netmask 255.255.255.0 gw 192.168.0.255 eth0
:wq

我知道PHP 调用系统底层命令 用exec 但是想知道 如何将这三句 同时执行呢?

------解决方案--------------------
最近也在做路由,我们的处理方法是,把文件写到文档里rc.local 里 然后system() 这个文件
------解决方案--------------------
1,脚本script.sh
C/C++ code

#!/bin/bash
route add default gw 192.168.0.255 eth0
route add -net 10.0.1.0 netmask 255.255.255.0 gw 192.168.0.255 eth0                     

人气教程排行