php重新安装curl扩展

因为我们的php不支持https,所以我们需要重新编译php,不过因为我们用的是M1,有一些问题待解决,最终失败在了php安装的make阶段,不过在过程中我们还是学习到了一些东西,先记录一下:

1:下载openssl
wget https://www.openssl.org/source/openssl-3.0.1.tar.gz
安装openssl
./config –prefix=/Applications/MxSrvs/libs/_openssl/3.0.1
./config –prefix=/Applications/MxSrvs/libs/_openssl/1.1.1o

make && make install

2:下载curl
https://curl.haxx.se/download/curl-7.77.0.zip
./configure –prefix=/Applications/MxSrvs/libs/_curl/7.77.0 –with-ssl=/Applications/MxSrvs/libs/_openssl/3.0.1
./configure –prefix=/Applications/MxSrvs/libs/_curl/7.77.0 –with-ssl=/Applications/MxSrvs/libs/_openssl/1.1.1o

配置后查看打印,是否支持https

Protocols:        DICT FILE FTP FTPS GOPHER GOPHERS HTTP HTTPS IMAP IMAPS LDAP LDAPS MQTT POP3 POP3S RTSP SMB SMBS SMTP SMTPS TELNET TFTP
Features:         AsynchDNS HSTS HTTPS-proxy IPv6 Largefile NTLM NTLM_WB SSL TLS-SRP UnixSockets alt-svc libz

从打印上来看,是支持https的,然后安装
make
make install

3:下载php(我们的版本是7.4.6,我们下载相同版本,但是我们没在官网上找到7.4.6,只有7.4.30,可能差距不大,我们就用此版本)

安装时发生错误:

configure: error: in `/Applications/MxSrvs/source/php-7.4.30':
configure: error: The pkg-config script could not be found or is too old.  Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.

Alternatively, you may set the environment variables LIBXML_CFLAGS
and LIBXML_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See `config.log' for more details

根据提示来看,是pck-config这个东西太旧,或者没找到。查找资料,说可以下载一下
我们尝试下载
brew install pkg-config

报了一个错,如下:

######################################################################## 100.0%
error: could not lock config file .git/config: Permission denied
Error: Command failed with exit 255: git

我们使用下面的方式,修改权限后解决

sudo chown -R $(whoami) $(brew --prefix)/*

再次执行 brew install pkg-config 完成安装

好了,继续安装php

.configure 又报了一个错
下载 https://ftp.gnu.org/pub/gnu/gettext/gettext-0.21.tar.gz
./configure –prefix=/Applications/MxSrvs/libs/_gettext/0.21

./configure –prefix=/Applications/MxSrvs/libs/_libiconv/1.17
./configure –prefix=/Applications/MxSrvs/libs/_libxml/2.9.12
./configure –prefix=/Applications/MxSrvs/libs/_libgd/2.3.3

php编译脚本:

./configure --prefix=/Applications/MxSrvs/bin/php --with-config-file-path=/Applications/MxSrvs/bin/php/etc --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv=/Applications/MxSrvs/libs/_libiconv/1.17 --with-zlib --with-curl --with-jpeg --with-freetype --with-openssl --with-mhash --with-gettext=/Applications/MxSrvs/libs/_gettext/0.21 --with-pear --without-gdbm --enable-gd --enable-mbstring --enable-ftp --enable-bcmath --enable-sockets --enable-xml --enable-mbregex --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-fpm --disable-fileinfo --disable-rpath PKG_CONFIG_PATH=/Applications/MxSrvs/libs/_libxml/2.9.9/lib/pkgconfig:/Applications/MxSrvs/libs/_openssl/1.1.1o/lib/pkgconfig:/Applications/MxSrvs/libs/_sqlite/3.31.1/lib/pkgconfig:/Applications/MxSrvs/libs/_curl/7.77.0/lib/pkgconfig:/Applications/MxSrvs/libs/_zlib/1.2.11/lib/pkgconfig:/Applications/MxSrvs/libs/_libpng/1.6.37/lib/pkgconfig:/Applications/MxSrvs/libs/_jpeg/9d/lib/pkgconfig:/Applications/MxSrvs/libs/_freetype/2.10.2/lib/pkgconfig:/Applications/MxSrvs/libs/_oniguruma/6.9.5/lib/pkgconfig:/Applications/MxSrvs/libs/_libgd/2.3.0/lib/pkgconfig:

暂无评论

相关推荐

php 脚本指定参数

<?php $param_arr = getopt('a:b:'); $a = $param_arr['a'] 调用 php script.php -av1 -bv2 注 …

php时间戳添加时分秒等偏移

我们使用time()可以打印出时间戳,但是我们想要加个偏移,比如用于缓存等,我们就要添加时分秒的偏移,可以用下边的代 …

服务器配置查询

nginx的配置查询 nginx -t 打印: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configu …

微信扫一扫,分享到朋友圈

php重新安装curl扩展