我想用在Ubuntu上的多線程PHP,但當我嘗試安裝包pthread
,我收到此錯誤信息:如何在ubuntu上啓用ZTS重新編譯php?
configure: error: pthreads requires ZTS, please re-compile PHP with ZTS enabled.
我想用在Ubuntu上的多線程PHP,但當我嘗試安裝包pthread
,我收到此錯誤信息:如何在ubuntu上啓用ZTS重新編譯php?
configure: error: pthreads requires ZTS, please re-compile PHP with ZTS enabled.
HOW TO INSTALL IN LINUX SYSTEM'S:
------------------------------------
1) Download PHP sources and Unpack PHP
2) Download PEAR
wget http://pear.php.net/go-pear.phar
php go-pear.phar
3) Download pthreads
Get PECL extension (PECL is a repository for PHP Extensions)
# pecl install pthread-0.4.4
4) Unpack pthreads
copy pthread-0.4.4 to php/ext
(for ./configure allow add option --enable-pthreads)
# mv build/php-src-master/ext/pthreads-master build/php-src-master/ext/pthreads
5) Reconfigure sources
# ./buildconf --force
# ./configure --help | grep pthreads
You should see the appropriate --enable-pthreads option listed as a result, if you do not, then
# rm -rf aclocal.m4
# rm -rf autom4te.cache/
# ./buildconf --force
6) Build PHP
Compile PHP source code
Add:
# ./configure --enable-debug --enable-maintainer-zts --enable-pthreads
7) Installing PHP
# make
# sudo make install
8) Update php.ini
Add in php.ini
extension=pthreads.so
Include_path = 「/usr/local/lib/php」
9) Check Modules
php -m (check pthread loaded)
10) Test Thread Class
# php SimpleTest.php
我認爲你可以使用這個PPA庫加PHP5與特稿啓用:
https://launchpad.net/~ondrej/+archive/ubuntu/php5
sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update
sudo apt-get upgrade
我有同樣的錯誤信息。 – lipdjo 2014-09-05 14:45:05
做PECL安裝並行線程-0.4.4我得到的錯誤: 沒有可用的軟件包「pecl.php.net/pthread」 安裝失敗 你知道我在做什麼錯了嗎? – 2015-08-12 14:13:51