编译安装PHP5.6

2023-12-23 22:34:02

PHP:安装PHP5.6

yum install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel -y

下载版本

wget https://www.php.net/distributions/php-5.6.40.tar.gz
./configure --prefix=/Users/user/Applications/php/5.6.40 \
--with-config-file-path=/Users/user/Applications/php/5.6.40/etc \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--enable-fpm  \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-iconv-dir \
--with-freetype-dir \
--with-jpeg-dir=/usr/local/Cellar/jpeg/9e \
--with-png-dir \
--with-zlib \
--with-libxml-dir \
--disable-fileinfo \
--disable-rpath \
--disable-debug \
--enable-bcmath \
--enable-xml \
--enable-shmop \
--enable-exif \
--enable-sysvsem \
--enable-inline-optimization \
--enable-mbregex \
--enable-mbstring \
--with-mcrypt \
--with-gd \
--enable-gd-native-ttf \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-ftp \
--with-curl \
--with-xsl \
--with-gettext \
--enable-zip \
--enable-soap \
--with-openssl="/usr/local/Cellar/openssl@1.1/1.1.1q"

配置文件

cp php.ini-production /Users/user/Applications/php/5.6.40/etc/php.ini

问题

问题1

configure: error: jpeglib.h not found.

安装

brew install libjpeg

添加到环境变量

~/.bash_profile

# libjpeg
export PATH="/usr/local/opt/jpeg/bin:$PATH"

问题2

configure: error: Cannot find OpenSSL’s <evp.h>

指定openssl的路径

--with-openssl="/usr/local/Cellar/openssl@1.1/1.1.1q"

参考

文章来源:https://blog.csdn.net/mouday/article/details/135174622
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。