Skip to content

Instantly share code, notes, and snippets.

@Vladnev
Last active June 9, 2023 07:48
Show Gist options
  • Save Vladnev/edac764e52aa99866ec84d393b80813f to your computer and use it in GitHub Desktop.
Save Vladnev/edac764e52aa99866ec84d393b80813f to your computer and use it in GitHub Desktop.
PPA:
sudo add-apt-repository ppa:ondrej/php-zts || sudo add-apt-repository ppa:nhojohl/php7-zts
sudo apt-get update
sudo apt-get install php7.0-zts php7.0-zts-dev
PHTHREADS:
cd ~/
git clone git://github.com/krakjoe/pthreads.git
cd pthreads
phpize
./configure
make
make test
sudo make install
CONFIGURATION:
sudo mkdir -p /etc/php/7.0-zts/conf.d/
sudo echo "extension=pthreads.so" > /etc/php/7.0-zts/conf.d/pthreads.ini #main php config
cd /etc/php/7.0-zts/cli/conf.d/
sudo ln -s ../../conf.d/pthreads.ini #cli php config
TEST:
php -r 'class T extends Thread{function run(){}};$t = new T();$t->start();'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment