您当前的位置:首页 > 计算机 > 系统应用 > macOS

MacOS编译安装PHP5.6

时间:05-21来源:作者:点击数:

PHP:安装PHP5.6

安装依赖可以省略,缺少哪个装哪个即可,类似linux

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"
make && make install

配置文件

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"

参考

方便获取更多学习、工作、生活信息请关注本站微信公众号城东书院 微信服务号城东书院 微信订阅号
推荐内容
相关内容
栏目更新
栏目热门