我的Mac上有一个本地主机开发环境,它使用自制软件的php公式,我试着用cURL的自定义路径安装,而不是使用SecureTransport for SSL的默认Mac OS版本(v7.54.0). SecureTransport会对远程服务的SSL请求造成很多问题,因此OpenSSL几乎是我的目的.
这是我到目前为止所采取的过程:
>使用OpenSSL通过家庭酿造安装卷曲:brew install curl –with-openssl
>编辑brew的php公式来修改编译过程,告诉./configure使用brew安装的curl(v7.59.0).我试过–with-curl = /usr/local/Cellar / curl / 7.59.0以及–with-curl =#{Formula [“curl”].opt_prefix}.第二个选项只是前者的动态符号链接.
>保存编辑并从源代码重建php:brew重新安装–build-from-source 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 Command值下看到以下内容:
'./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'
如果你注意到,在它的尾部有一个尾随 – 卷曲,而其他一切都是在brew公式中定义的顺序.我不知道在./configure命令中将其附加到何处或如何,但这可能与问题的原因有关.
作为参考,这里是Brew的修改后的php.rb公式的确切内容:
https://gist.github.com/Kevinlearynet/a44ffa2107a1b6e09935766a9e46cfd4
不管怎样,我完全被这里难住了.非常感谢任何帮助或帮助.
解决方法:
我已经应用了由dossy提供的补丁,它可以工作!
以下是解决问题的具体步骤.有关此修复程序的更多详细信息,请参见下文.
> cd /usr/local/Homebrew / Library / Taps / homebrew / homebrew-core
> curl -s https://github.com/dossy/homebrew-core/commit/b75fe286f79e2b89548c5ed1bbe1958313c5c103.patch |补丁-p1
> brew重新安装php –build-from-source
问题的具体来源似乎是需要libxml2库来替换Mac的内置libcurl,这最终迫使PHP依赖于SecureTransport. php.rb中的这两行是我修复的关键部分:
> depends_on“libxml2”
> –with-libxml-dir =#{Formula [“libxml2”].opt_prefix}
对于我的具体情况,我不得不将我的编辑家酿啤酒配方(php.rb)重置为源,因为我之前编辑过它.因此,应用补丁最初不起作用.如果您还编辑了php.rb公式,那么我将其重置为源:https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/php.rb.
在medium.com上的链接文章中,dossy建议在应用于补丁之后构建以下命令,brew安装php –build-from-source.如果您已安装PHP,则需要使用重新安装代替安装.
原文地址:https://codeday.me/bug/20191006/1858377.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。