我在github PThread项目页面上看到php7+是受支持的。
我有php7.1.6关于ubuntu的发行版(16.04)
我找不到任何提供php7.1-zts的PPA。
如何使php7.1上的zts安装p线程?
发布于 2017-06-26 11:15:19
这是我的安装脚本
#!/bin/bash
mkdir -p /etc/php7
mkdir -p /etc/php7/cli
git clone https://github.com/php/php-src.git -b PHP-7.0.17 --depth=1
cd php-src/ext
git clone https://github.com/krakjoe/pthreads -b master pthreads
cd ..
./buildconf --force
./configure --prefix=/etc/php7 --with-bz2 --with-zlib --enable-zip --disable-cgi \
--enable-soap --enable-intl --with-mcrypt --with-openssl --with-readline --with-curl \
--enable-ftp --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
--enable-sockets --enable-pcntl --with-pspell --with-enchant --with-gettext \
--with-gd --enable-exif --with-jpeg-dir --with-png-dir --with-freetype-dir --with-xsl \
--enable-bcmath --enable-mbstring --enable-calendar --enable-simplexml --enable-json \
--enable-hash --enable-session --enable-xml --enable-wddx --enable-opcache \
--with-pcre-regex --with-config-file-path=/etc/php7/cli \
--with-config-file-scan-dir=/etc/php7/etc --enable-cli --enable-maintainer-zts \
--with-tsrm-pthreads --enable-debug --enable-fpm \
--with-fpm-user=www-data --with-fpm-group=www-data
make && make install
chmod o+x /etc/php7/bin/phpize
chmod o+x /etc/php7/bin/php-config
cd ext/pthreads*
/etc/php7/bin/phpize
./configure --prefix=/etc/php7 --with-libdir=/lib/x86_64-linux-gnu --enable-pthreads=shared --with-php-config=/etc/php7/bin/php-config
make && make install
cd ../../
cp -r php.ini-development /etc/php7/cli/php.ini
cp php.ini-development /etc/php7/cli/php-cli.ini
echo "extension=pthreads.so" > /etc/php7/cli/php-cli.ini
echo "zend_extension=opcache.so" >> /etc/php7/cli/php.ini
ln --symbolic /etc/php7/bin/php /usr/bin/php
export USE_ZEND_ALLOC=0此外,您也可以使用我的码头-容器docker pull buildok/zts。
发布于 2021-03-29 15:03:59
Ubuntu服务器上的
我把版本改为7.4.16
git clone https://github.com/php/php-src.git -b PHP-7.0.17 --depth=1
在重新编译PHP之前,我必须安装一些依赖项。
所需的一揽子计划是:
apt install bison re2c zlib1g-dev sqlite3 libsqlite3-dev libbz2-dev libcurl4-openssl-dev libenchant-dev libonig-dev libpspell-dev libedit-dev libreadline-dev libxslt-dev
还警告:未识别的选项:启用-zip、-with-mcrypt、-with-gd、-with-jpeg-dir、-with-png-dir、-with-freetype-dir、-启用散列、-启用-wddx、-with regex。
因此,在php7.4中,您可能希望这样做:./configure --prefix=/etc/php7 --with-bz2 --with-zlib --enable-zip --disable-cgi \ --enable-soap --enable-intl with-openssl --with-readline --with-curl \ --enable-ftp --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \ --enable-sockets --enable-pcntl --with-pspell --with-enchant --with-gettext \ --enable-exif --with-xsl \ --enable-bcmath --enable-mbstring --enable-calendar --enable-simplexml --enable-json \ --enable-session --enable-xml --enable-opcache \ --with-config-file-path=/etc/php7/cli \ --with-config-file-scan-dir=/etc/php7/etc --enable-cli --enable-maintainer-zts \ --with-tsrm-pthreads --enable-debug --enable-fpm \ --with-fpm-user=www-data --with-fpm-group=www-data
在您发现php7.4与p线程不兼容之后,您会发现这个错误,在这个错误中,维护人员已经停止了p线程的开发并移动到并行。https://github.com/krakjoe/pthreads/issues/929
https://stackoverflow.com/questions/44756284
复制相似问题