pthreads 安装error: pthreads requires ZTS,please re-compile PHP with ZTS enabled

本文介绍了如何解决在安装phppthread扩展过程中遇到的问题,包括重新编译PHP并启用ZTS支持,以及配置php.ini文件的具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

研发的同事要求安装php pthread扩展!
   tar zxvf pthreads-0.0.44.tgz 
   cd pthreads-0.0.44
 
   /usr/local/webserver/php/bin/phpize 
   ./configure  --with-php-config=/usr/local/webserver/php/bin/php-config 
##但在configure时却出错,提示:
configure: error: pthreads requires ZTS, please re-compile PHP with ZTS enabled
原因: 我在编译php的时候没有加入 --enable-maintainer-zts   ,这个必须要重新编译php,不能动态加载的!
于是我重新编译了php,在原来的编译参数基础上那个加入了  --enable-maintainer-zts ,重新编译安装php即可!
   make
   make install
并在php.ini中加入:
extension_dir = "/usr/local/webserver/php/lib/php/extensions/no-debug-zts-20100525"  ##必须和你的目录相对应!
extension =pthreads.so
重启php服务!/etc/init.d/php-fpm restart

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值