如何在Centos 7上手动安装PHP-Zts [英] How to Install PHP-Zts manually on the Centos 7
问题描述
我想安装pthreads.当我尝试安装时,我会收到此错误:
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
现在,如何在启用了Zts的情况下安装Php?
now, how I can install Php with enabled Zts?
推荐答案
我有一个用于启用PHP-Zts(7.2.26)的命令列表:
There I have a command list for enabling PHP-Zts (7.2.26):
1-将安装目录更改为主目录:
1- Change installation directory to home:
cd ~
2-获取所需的PHP版本:
2- Get Php version you want:
wget http://www.php.net/distributions/php-7.2.26.tar.gz
3-提取PHP文件
tar zxvf php-7.2.26.tar.gz
4-重新配置源
./buildconf --force
5-在php-7.2.26文件夹中,运行configure命令来设置我们需要的内容:
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-安装PHP(安装可能需要5到10分钟)
6- Install PHP ( maybe take 5 ~ 10 minutes for installation )
make && make install
7-复制PHP的配置文件并添加本地lib以包含路径
7- Copy configuration file of PHP and add local lib to include path
cp php.ini-development /etc/php.ini
8-编辑php.ini并将Include_path设置如下:
8- Edit php.ini and set Include_path to be like this:
Include_path = "/usr/local/lib/php"
现在,您已经安装了已启用Zts 的php-7.2.26.
Now you have installed php-7.2.26 with enabled Zts.
这篇关于如何在Centos 7上手动安装PHP-Zts的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!