Shahrad Elahi
Shahrad Elahi

Reputation: 1322

How to Install PHP-Zts manually on the Centos 7

I want to install pthreads. When I'm trying to install I will receive this error:

checking for ZTS... no

configure: error: pthreads requires ZTS, please re-compile PHP with ZTS enabled

now, how I can install Php with enabled Zts?

Upvotes: 3

Views: 4822

Answers (1)

Shahrad Elahi
Shahrad Elahi

Reputation: 1322

There I have a command list for enabling PHP-ZTS (7.2.26):

1- Change installation directory to home:

cd ~

2- Get PHP version you want:

wget http://www.php.net/distributions/php-7.2.26.tar.gz

3- Extract PHP file

tar zxvf php-7.2.26.tar.gz

4- Reconfigure sources

cd php-7.2.26 && ./buildconf --force

5- Inside the php-7.2.26 folder, run configure command to set what we need:

./configure --enable-debug --enable-maintainer-zts --prefix=/usr --with-config-file-path=/etc

6- Install PHP (maybe take 5 ~ 10 minutes for installation)

make && make install

7- Copy configuration file of PHP and add local lib to include path

cp php.ini-development /etc/php.ini

8- Edit php.ini and set Include_path to be like this:

Include_path = “/usr/local/lib/php”

Now you have installed php-7.2.26 with enabled ZTS.


UPDATE: Here is new command list for php-8.0 installation with ZTS.

1- Download and unpacking:

wget http://www.php.net/distributions/php-8.0.2.tar.gz && tar zxvf php-8.0.2.tar.gz

2- My server has need some packages, and you may face something else

yum install -y libxml2-devel sqlite-devel

3- Configuration (In this step, we're enabling the ZTS)

cd php-8.0.2 && ./buildconf --force && ./configure --enable-debug --enable-zts --prefix=/usr --with-config-file-path=/etc

4- Installation (This action may take few minutes)

make && make install

Congratulation now you installed new PHP version with enabled ZTS.

Upvotes: 5

Related Questions