Linux centos 安装php5.4和pthreads

摘要:
https://www.php.net/distributions/php-5.4.36.tar.gz#wgethttp:error:

原文章:https://blog.csdn.net/weixin_42135441/article/details/82743893

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  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

Linux centos 安装php5.4和pthreads第1张

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

# 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 --with-mcrypt=/usr/local/libmcrypt  --with-mysqli  --with-freetype-dir=/usr/local/freetype --with-iconv --with-zlib --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-curl --enable-ctype

Linux centos 安装php5.4和pthreads第2张

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

6.configure: Cannot find OpenSSL's <evp.h>

解决方式

# yum install openssl openssl-devel

7.configure:Please reinstall the libcurl distribution -

    easy.h should be in <curl-dir>/include/curl/

解决方式

# yum -y install curl-devel

8.configure:freetype.h not found.

解决方式

# yum install freetype-devel

9.configure: error: mcrypt.h not found. Please reinstall libmcrypt.

解决方式:

# yum install libmcrypt libmcrypt-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

https://blog.csdn.net/qq_36180117/article/details/80813093

免责声明:文章转载自《Linux centos 安装php5.4和pthreads》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇性能测试三十一:监控之工具监控微信小程序-注册相关流程下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

git问题ERROR: Repository not found

报错内容:remote: Repository not found. fatal: repository 'https://github.com/pete/first_app.git/' not found 解决方法:三个命令中的一个git config --unset-all credential.helper git config --global -...

LFI-labs

CMD-1 查看源代码: <?php system($_GET["cmd"]); ?> 这个没有任何过滤,直接命令执行即可。payload: ?cmd=whoani CMD-2 这题和上面一样,只不过改成了POST请求。 CMD-3 查看源码: <?php system("/usr/bin/whois " . $_G...

[Deepin 15] 编译安装 PHP-5.6.30

先看下历史笔记: Ubuntu 14 编译安装 PHP 5.4.45 + Nginx 1.4.7 + MySQL 5.6.26 笔记 ################################################## ### 安装PHP依赖库 ##############################################...

php持续集成环境笔记

记录下php集成环境中若干个工具的安装步骤和过程: 安装pear wget http://pear.php.net/go-pear.phar $ php go-pear.phar 使用:pear install <要安装的pear程序包> 安装phpunit pear channel-discover pear.phpunit.de p...

如何让您的php也支持pthreads多线程

  我们常常会碰到这样一种情况,开发环境在windows下开发,而生产环境确是linux。windows下能正常运行,上传到linux后却无法好好地玩耍了。然后开始了一轮尼玛式的疯狂的查找原因,最后发现是服务器环境问题。这时只能默默地爆一句shit。最近在用php多线程开发一个小功能也碰到类似的问题,在此记录一下。   1、查找资料发现php5.3或以上,...

php 获取远程图片长宽和大小

/***获取远程图片的宽高和体积大小** @param string $url 远程图片的链接* @param string $type 获取远程图片资源的方式, 默认为 curl 可选 fread* @param boolean $isGetFilesize 是否获取远程图片的体积大小, 默认false不获取, 设置为 true 时 $type 将强制为...