我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

PHP Exec在linux中同时执行两个命令

I want to execute two commands at the same time, I am using if((bool)@$ip) shell_exec("command1; command2");

it does work but it needs to finish one command and then it will start to do the other command.

Can I have some help please? Thanks

If you put the & symbol at the end of the first command, it will run that command in the background (asynchronously) so that your PHP script will continue to the next line, where you can fire off the next command.

近期文章

  • MySQL - 查询列的重复项并返回原始行和重复行
  • 使用codeigniter从数据库中显示图像及其附带信息
  • PHPExcel_IOFactory :: load throw uncaught异常并导致脚本停止
  • HTTPS GET请求https://www.googleapis.com/plus/v1/people/me
  • 格式化url字符串PHP数组
  • PHP require_once目录问题
  • codeigniter全局模型实例
  • $ _GET没有使用javascript更新网站
  • 如何通过它的索引访问JSON属性
  • 第一次登录时显示欢迎消息
  • 使用mysql的垂直菜单不会显示数据
  • 如何知道在codeigniter中使用URL调用哪个控制器
  • preg_match_all没有从php中的文件中获取图像src
  • 如何将脚本添加到Joomla 2.5中的脚本列表顶部
  • 获取函数可以采用的参数总数
  • 工资回报问题:
  • 删除json值
  • 结合MySQL查询
  • ZF2 - 可以覆盖工厂吗?
  • PHP电子邮件不起作用[关闭]

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华