如何在ubuntu上启用ZTS重新编译php?

lip*_*djo 5 php ubuntu thread-safety

我想在Ubuntu上使用多线程PHP,但是当我尝试安装包时pthread,我收到以下错误消息:

configure:错误:pthreads需要ZTS,请在启用ZTS的情况下重新编译PHP.

Rag*_*420 4

HOW TO INSTALL IN LINUX SYSTEM'S:\n------------------------------------\n\n1) Download PHP sources and Unpack PHP\n\n2) Download PEAR\n     wget http://pear.php.net/go-pear.phar\n     php go-pear.phar\n\n3) Download pthreads\nGet PECL extension (PECL is a repository for PHP Extensions)\n\n# pecl install pthread-0.4.4\n\n4) Unpack pthreads\ncopy pthread-0.4.4  to  php/ext\n(for ./configure allow  add option --enable-pthreads)\n\n# mv build/php-src-master/ext/pthreads-master    build/php-src-master/ext/pthreads\n\n5)  Reconfigure sources\n# ./buildconf --force\n# ./configure --help | grep pthreads\n\nYou should see the appropriate --enable-pthreads option listed as a result, if you do not, then\n\n# rm -rf aclocal.m4\n# rm -rf autom4te.cache/\n# ./buildconf --force\n\n6) Build PHP\nCompile PHP source code\nAdd:\n# ./configure --enable-debug --enable-maintainer-zts --enable-pthreads\n\n7) Installing PHP\n# make\n# sudo make install\n\n8) Update php.ini\nAdd in php.ini\nextension=pthreads.so\nInclude_path = \xe2\x80\x9c/usr/local/lib/php\xe2\x80\x9d\n\n9) Check Modules\nphp -m (check pthread loaded)\n\n10) Test Thread Class\n# php SimpleTest.php\n
Run Code Online (Sandbox Code Playgroud)\n