如何在Ubuntu中使用Pthreads PHP扩展 [英] How to use Pthreads PHP extension in Ubuntu

查看:105
本文介绍了如何在Ubuntu中使用Pthreads PHP扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Pthreads PHP扩展出现问题.我已经在启用ZTS的情况下(--enable-maintainer-zts)编译了PHP,并通过pecl安装了pthreads,还尝试了手动编译扩展名.

I have problems with the Pthreads PHP extension. I have compiled PHP with ZTS enabled (--enable-maintainer-zts) and installed the pthreads via pecl and also tried to manually compile the extension.

似乎我实际上并不知道如何使用它.我以为我可以像其他内置类一样在PHP中使用Thread类,但是运气不好,因为PHP无法识别它. POSIX函数似乎可以正常工作.

It seems I don't actually know how to use it. I assumed I would be able to use the Thread class in PHP like any other built-in class, but with no luck as PHP doesn't recognize it. POSIX functions seem to work.

我正在将64位Ubuntu 12.10 Server与mod_php 5.4.6结合使用.

I am using Ubuntu 12.10 Server 64-bit with mod_php 5.4.6.

推荐答案

如果无法访问扩展类,则不会加载它.

If you cannot access the extensions classes then it is not loaded.

我认为您打开了一个错误报告,对此我的答复是您的配置行格式错误.

I think you opened a bug report, to which I responded that your configure line is malformed.

您要使用的配置行是:

./configure --enable-pthreads --enable-maintainer-zts

以上命令将pthreads作为DSO构建.

The above command will build pthreads as a DSO.

./configure --enable-pthreads=static --enable-maintainer-zts

以上命令将pthreads静态地构建到PHP中.

The above command will build pthreads statically into PHP.

5.3、5.4甚至5.5均对两者均提供支持.

Both are equally supported by 5.3, 5.4 and even 5.5.

此外,如果要覆盖系统安装,则应使用特定的--prefix,例如,如果php可执行文件位于/usr/bin(可以通过哪个php"确定),则--prefix=/usr将覆盖您的系统安装.

Additionally, if you are overwriting your system installation then you should use a specific --prefix, for example, if you php executable is at /usr/bin ( which you can ascertain with "which php" ), then --prefix=/usr will overwrite your system installation.

清理旧的安装(如果源仍然可用,请进行卸载).重新开始,确保您覆盖了系统安装或完全隔离了该安装.

Clean out your old installations ( do make uninstall if the sources are still available ). Start again, ensure you are either, overwriting the system installation or isolating this one completely.

解决后,请更新错误报告.

Please update the bug report when you have worked it out.

这篇关于如何在Ubuntu中使用Pthreads PHP扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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