centos wget 安装php和pthreads

之前通过yum安装了php5.4,现在需要安装pthreads拓展,./configure --enable-maintainer-zts不可用,只能重新安装一次php

1.下载php5.4和pthreads并解压。

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

# wget http://pecl.php.net/get/pthreads-1.0.0.tgz

# tar zxvf php-5.4.36.tar.gz

# tar zxvf php pthreads-1.0.0.tgz

2. 将 解压的 pthreads-1.0.0放入php-5.4.36下的ext目录下

mv pthreads-1.0.0 php-5.4.36/ext

3.重新配置资源

# cd php-5.4.36

# ./buildconf --force

       查看一下是否已经有pthreads

# ./configure -- help | grep pthreads


     如果没有,执行下面命令重新配置

# rm -rf aclocal.m4

# rm -rf autom4te.cache/

# ./configure -- help | grep pthreads

4.配置需要一起安装的拓展

# ./configure --enable-debug --enable-maintainer-zts --enable-pthreads --prefix=/usr --with-config-file-path=/etc --enable-fpm --with-mysql  --with-mysql-sock=/var/lib/mysql/mysql.sock --with-pdo-mysql --with-gd --with-libxml-dir=/usr/local/libxml2 --with-png-dir=/usr/local/libpng  --with-jpeg-dir=/usr/local/jpeg9 --with-vpx-dir=/usr/local/vpx

5.安装

# make

# make install

6.配置php-fpm配置为服务

cp /root/php-5.4.36/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm 

cp /usr/etc/php-fpm.conf.default /usr/etc/php-fpm.conf

chmod 755 /etc/init.d/php-fpm

chkconfig –add php-fpm

最后,php-fpm以服务的方式启动、停止和重启:
service php-fpm start
service php-fpm stop

service php-fpm reload


至此php+pthreads安装成功


第4步遇见的错误

1.configure: error: no acceptable C compiler found in $PATH

解决方式 

#yum install gcc-c++

2.configure: error: xml2-config not found. Please check your libxml2 installation.

解决方式

# yum install libxml2

# yum install libxml2-devel -y

3.configure: error: jpeglib.h not found.

解决方式 

# yum -y install libjpeg-devel

4. configure: error: vpx_codec.h not found.

解决方式

# yum -y install libvpx-devel

5.configure: error: png.h not found.

解决方式

# yum -y install libpng-devel

参考文章:

http://php.net/manual/en/pthreads.installation.php

https://blog.csdn.net/zyz511919766/article/details/14002497/

https://blog.csdn.net/dabao1989/article/details/22898857

https://www.cnblogs.com/beyang/p/6972412.html

文章来源: centos wget 安装php和pthreads

人吐槽 人点赞

猜你喜欢

发表评论

用户名: 密码:
验证码: 匿名发表

你可以使用这些语言

查看评论:centos wget 安装php和pthreads