...
Excerpt |
---|
To run thread safe application in PHP, you will need to install PThread manually, because it's not included in the common distribution. |
The precondition you should have is all the required PHP plugins and run below commands:
Code Block |
---|
# PULL DOWN the PTHREADS GIT REPO:
git clone https://github.com/krakjoe/pthreads.git
cd pthreads
zts-phpize
./configure --with-php-config=/usr/bin/zts-php-config
make
# COPY EXTENSION TO PHP-ZTS MODULES FOLDER:
cp modules/pthreads.so /usr/lib64/php-zts/modules/.
# ENABLE EXTENSION IN PHP-ZTS, BY CREATING A FILE:
vi /etc/php-zts.d/pthreads.ini
# ADD THIS TO THE FILE AND SAVE:
extension=pthreads.so |
You can check to see if you got it working:
Code Block |
---|
zts-php -i | grep -i thread |
It should be something like:
Code Block |
---|
/etc/php-zts.d/pthreads.ini
Thread Safety => enabled
pthreads |
Now you can invoke programs that need threading and pthreads by using:
Code Block |
---|
zts-php (instead of php) |
Below reference contains the required steps for PThread
...