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
#!/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 <div class="clear"></div>
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号