【发布时间】:2015-12-24 01:25:41
【问题描述】:
我的 ubuntu 上有 apache2 网络服务器。我需要安装pthreads,所以我从rep(复制到/ext/)克隆了一个php7和pthreads的源代码。 我为 php 安装了所有库,然后我运行了
./buildconf
和
./configure --prefix=/usr --with-config-file-path=/etc --enable-bcmath --enable-calendar --enable-cli --enable-debug --enable-dba - -enable-exif --enable-ftp --enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-pcntl --enable-shmop --enable-soap --enable-opcache -- enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --enable-zip --enable-maintainer-zts --with-freetype-dir= /usr/local/opt/freetype --with-openssl --with-gd --with-gettext=/usr/local/opt/gettext --with-iconv-dir=/usr --with-icu-dir= /usr --with-mhash --with-jpeg-dir=/usr/local/opt/jpeg --with-kerberos=/usr --with-libedit --with-mhash --with-png-dir=/ usr/local/opt/libpng --with-zlib=/usr --with-apxs2=/usr/bin/apxs --libexecdir=/usr/local/php7/7.0.0/libexec --with-bz2=/usr --enable-fpm --with-fpm-user=_www --with-fpm-group=_www --with-curl --with-mysqli=mysqlnd --with-pdo-mysql =mysqlnd --with-mcrypt --enable-pthreads.
它完成得很好,我执行了“make”和“make install”。 然后我在控制台中执行了下一个命令:
sudo a2dismod php5
sudo cp /etc/apache2/mods-available/php5.conf /etc/apache2/mods-enabled/php7.conf
sudo rm -rf /usr/bin/php && sudo ln -s /etc /usr/bin/php
sudo service apache2 restart
通过这种方式,我得到了带有 php7 的 apache2,但它没有启动并为我提供日志:
PHP 致命错误:pthreads 不支持 apache2handler SAPI 在第 0 行的未知 PHP 致命错误:无法启动 pthreads 模块 在第 0 行 Unknown(0) 上的未知中:致命错误 - apache2handler pthreads Unknown(0) 不支持 SAPI:致命错误 - 无法 启动 pthreads 模块
如果我在没有 --enable-pthreads 的情况下配置 php7,它可以工作。我执行了 phpinfo() 并得到了结果。
我该如何解决这个问题?
【问题讨论】:
标签: php ubuntu pthreads apache2 php-7