PHP 7中的多线程 [英] Multithreading in PHP 7

查看:78
本文介绍了PHP 7中的多线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在PHP7中进行多线程处理?我看到的与pthread有关的第一个问题直接来自PHP手册.

How to do multithreading in PHP7? The first problem I see with pthread is coming directly from PHP manual.

https://secure.php.net/manual/en/intro .pthreads.php

pthreads 扩展不能 Web服务器环境中使用.因此,PHP中的线程应该只保留给基于CLI的应用程序.

The pthreads extension cannot be used in a web server environment. Threading in PHP should therefore remain to CLI-based applications only.

可以安全地查看此警告,并在HTTP请求上生成一些线程吗?

Is is safe to oversee this warning, and spawn some threads on HTTP requests?

推荐答案

可以安全地查看此警告,并在HTTP请求上生成一些线程吗?

Is is safe to oversee this warning, and spawn some threads on HTTP requests?

扩展本身禁止在CLI之外的任何地方进行加载:尝试加载任何其他SAPI都会导致致命错误.

The extension itself prohibits loading anywhere but CLI: Attempting to load in any other SAPI will result in a fatal error.

这篇关于PHP 7中的多线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆