首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >使用cURL安装Home Brew PHP 7.2.5

使用cURL安装Home Brew PHP 7.2.5
EN

Stack Overflow用户
提问于 2018-05-10 02:27:51
回答 1查看 6.9K关注 0票数 5

我在我的Mac上有一个本地主机开发环境,它使用的是自制的php公式,而我正在竭尽全力地尝试安装到cURL的自定义路径,而不是使用SecureTransport for SSL的默认Mac版本(v7.54.0)。SecureTransport会导致很多关于远程服务的SSL请求的问题,所以OpenSSL对于我的目的来说是非常必要的。

以下是我到目前为止所采用的过程:

brew install curl --with-openssl

  • Edited

  • 通过带有OpenSSL的home brew安装curl:php brew的php公式修改编译过程,告知./configure使用brew安装的curl (v7.59.0)。我尝试过--with-curl=/usr/local/Cellar/curl/7.59.0--with-curl=#{Formula["curl"].opt_prefix}。第二个选项只是一个指向前者的动态符号链接。brew reinstall --build-from-source php

  • 保存编辑并从源重新构建php

为了验证我是否有写./configure选项,我在我的Brew公式编辑中添加了一个临时行,它输出传递的args。这看起来是这样的:

--prefix=/usr/local/Cellar/php/7.2.5
--localstatedir=/usr/local/var
--sysconfdir=/usr/local/etc/php/7.2
--with-config-file-path=/usr/local/etc/php/7.2
--with-config-file-scan-dir=/usr/local/etc/php/7.2/conf.d
--with-pear=/usr/local/Cellar/php/7.2.5/share/php/pear
--enable-bcmath
--enable-calendar
--enable-dba
--enable-dtrace
--enable-exif
--enable-ftp
--enable-fpm
--enable-intl
--enable-mbregex
--enable-mbstring
--enable-mysqlnd
--enable-opcache-file
--enable-pcntl
--enable-phpdbg
--enable-phpdbg-webhelper
--enable-shmop
--enable-soap
--enable-sockets
--enable-sysvmsg
--enable-sysvsem
--enable-sysvshm
--enable-wddx
--enable-zip
--with-apxs2=/usr/local/opt/httpd/bin/apxs
--with-bz2
--with-curl=/usr/local/Cellar/curl/7.59.0
--with-fpm-user=_www
--with-fpm-group=_www
--with-freetype-dir=/usr/local/opt/freetype
--with-gd
--with-gettext=/usr/local/opt/gettext
--with-gmp=/usr/local/opt/gmp
--with-icu-dir=/usr/local/opt/icu4c
--with-jpeg-dir=/usr/local/opt/jpeg
--with-kerberos
--with-layout=GNU
--with-ldap
--with-ldap-sasl
--with-libedit
--with-libzip
--with-mhash
--with-mysql-sock=/tmp/mysql.sock
--with-mysqli=mysqlnd
--with-ndbm
--with-openssl=/usr/local/opt/openssl
--with-password-argon2=/usr/local/opt/argon2
--with-pdo-dblib=/usr/local/opt/freetds
--with-pdo-mysql=mysqlnd
--with-pdo-odbc=unixODBC,/usr/local/opt/unixodbc
--with-pdo-pgsql=/usr/local/opt/libpq
--with-pgsql=/usr/local/opt/libpq
--with-pic
--with-png-dir=/usr/local/opt/libpng
--with-pspell=/usr/local/opt/aspell
--with-sodium=/usr/local/opt/libsodium
--with-unixODBC=/usr/local/opt/unixodbc
--with-webp-dir=/usr/local/opt/webp
--with-xmlrpc
--with-xsl
--with-zlib

从所有密集的目的来看,这应该是有效的,但是当我在从源重新安装php之后打开一个phpinfo()时,我在配置命令值下面看到了以下内容:

'./configure' 
'--prefix=/usr/local/Cellar/php/7.2.5' 
'--localstatedir=/usr/local/var' 
'--sysconfdir=/usr/local/etc/php/7.2' 
'--with-config-file-path=/usr/local/etc/php/7.2' 
'--with-config-file-scan-dir=/usr/local/etc/php/7.2/conf.d' 
'--with-pear=/usr/local/Cellar/php/7.2.5/share/php/pear' 
'--enable-bcmath' 
'--enable-calendar' 
'--enable-dba' 
'--enable-dtrace' 
'--enable-exif' 
'--enable-ftp' 
'--enable-fpm' 
'--enable-intl' 
'--enable-mbregex' 
'--enable-mbstring' 
'--enable-mysqlnd' 
'--enable-opcache-file' 
'--enable-pcntl' 
'--enable-phpdbg' 
'--enable-phpdbg-webhelper' 
'--enable-shmop' 
'--enable-soap' 
'--enable-sockets' 
'--enable-sysvmsg' 
'--enable-sysvsem' 
'--enable-sysvshm' 
'--enable-wddx' 
'--enable-zip' 
'--with-apxs2=/usr/local/opt/httpd/bin/apxs' 
'--with-bz2' 
'--with-fpm-user=_www' 
'--with-fpm-group=_www' 
'--with-freetype-dir=/usr/local/opt/freetype' 
'--with-gd' 
'--with-gettext=/usr/local/opt/gettext' 
'--with-gmp=/usr/local/opt/gmp' 
'--with-icu-dir=/usr/local/opt/icu4c' 
'--with-jpeg-dir=/usr/local/opt/jpeg' 
'--with-kerberos' 
'--with-layout=GNU' 
'--with-ldap' 
'--with-ldap-sasl' 
'--with-libedit' 
'--with-libzip' 
'--with-mhash' 
'--with-mysql-sock=/tmp/mysql.sock' 
'--with-mysqli=mysqlnd' 
'--with-ndbm' 
'--with-openssl=/usr/local/opt/openssl' 
'--with-password-argon2=/usr/local/opt/argon2' 
'--with-pdo-dblib=/usr/local/opt/freetds' 
'--with-pdo-mysql=mysqlnd' 
'--with-pdo-odbc=unixODBC,/usr/local/opt/unixodbc' 
'--with-pdo-pgsql=/usr/local/opt/libpq' 
'--with-pgsql=/usr/local/opt/libpq' 
'--with-pic' 
'--with-png-dir=/usr/local/opt/libpng' 
'--with-pspell=/usr/local/opt/aspell' 
'--with-sodium=/usr/local/opt/libsodium' 
'--with-unixODBC=/usr/local/opt/unixodbc' 
'--with-webp-dir=/usr/local/opt/webp' 
'--with-xmlrpc' 
'--with-xsl' 
'--with-zlib' 
'--with-curl'

如果您注意到了,在它的尾部有一个尾随的--with-curl,而其他所有内容都是在brew公式中定义的顺序。我不知道这是在哪里以及如何附加到./configure命令上的,但这可能与问题的原因有关。

作为参考,以下是修改后的Brew php.rb公式的确切内容:

https://gist.github.com/Kevinlearynet/a44ffa2107a1b6e09935766a9e46cfd4

不管怎样,我在这里完全被难住了。任何帮助或帮助都是非常感谢的。

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50259893

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档