PHP mit Threads compilieren


title: “PHP mit Threads compilieren”
date: 2014-10-29T10:52:44
slug: php-mit-threads-compilieren


PHP Version 5.6.X downloaden und konfigurieren:

./configure --prefix=/usr/share/php56 --datadir=/usr/share/php56 --mandir=/usr/share/man --bindir=/usr/bin/php56 --with-libdir=lib/x86\_64-linux-gnu --includedir=/usr/include/php56 --sysconfdir=/etc/php56/apache2 --with-config-file-path=/etc/php56/apache2 --with-config-file-scan-dir=/etc/php56/conf.d --enable-libxml --enable-session --with-pcre-regex=/usr --enable-xml --enable-simplexml --enable-filter --disable-debug --enable-inline-optimization --disable-rpath --disable-static --enable-shared --with-pic --with-gnu-ld --with-mysql --with-gd --with-jpeg-dir --with-png-dir --with-xpm-dir --enable-exif --with-zlib --with-bz2 --with-curl --with-mysqli --with-freetype-dir --enable-soap --enable-sockets --enable-calendar --enable-ftp --enable-mbstring --enable-gd-native-ttf --enable-bcmath --enable-zip --with-pear --with-openssl --with-imap --with-imap-ssl --with-kerberos --enable-phar --enable-pdo --with-pdo-mysql --with-mysqli --enable-intl --with-mcrypt --with-tsrm-pthreads --enable-maintainer-zts

Dann compilieren und installieren:

make
make install

Neuste pthreads Source runterladen und entpacken:

w3m http://pecl.php.net/get/pthreads
tar -xvf pthreads-2.0.10.tgz

Dann ein:

cd pthreads-2.0.10
/usr/bin/php56/phpize

(Evtl. muss autoconf installiert werden: apt-get install autoconf)

pthreads configurieren:

./configure --with-php-config=/usr/bin/php56/php-config

pthreads compilieren und instllieren

make
make install

Jetzt müsste eine Datei namens pthreads.so im Verzeichnis /usr/share/php56/lib/php/extensions/no-debug-zts-20131226/ exitieren

Jetzt die php.ini aus den sourcen nach /etc/php56/cli kopieren

cp php.ini-development /etc/php56/conf.d/php.ini

Dann noch die extension in der php.ini Datei eintragen

extension=/usr/share/php56/lib/php/extensions/no-debug-zts-20131226/pthreads.so

Checken in php mit pthreads funktioniert:

/usr/bin/php56/php -m | grep pthreads

Ergebnis sollte sein:

pthreads
Print Friendly, PDF & Email