php - 在 PHP 7.0.13 上安装 mysqlnd 时找不到 OpenSSL 的 <evp.h>

标签 php c pdo php-7 mysqlnd

尝试在 PHP 7.0.13 上安装 mysqlnd 扩展时出现以下错误。

根据locate evp.h,我的openssl 文件位于/usr/include/openssl/

已经尝试过这些:

仍然出现同样的错误。

./configure
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /root/.phpbrew/php/php-7.0.13
checking for PHP includes... -I/root/.phpbrew/php/php-7.0.13/include/php -I/root/.phpbrew/php/php-7.0.13/include/php/main -I/root/.phpbrew/php/php-7.0.13/include/php/TSRM -I/root/.phpbrew/php/php-7.0.13/include/php/Zend -I/root/.phpbrew/php/php-7.0.13/include/php/ext -I/root/.phpbrew/php/php-7.0.13/include/php/ext/date/lib
checking for PHP extension directory... /root/.phpbrew/php/php-7.0.13/lib/php/extensions/no-debug-non-zts-20151012
checking for PHP installed headers prefix... /root/.phpbrew/php/php-7.0.13/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking whether to enable mysqlnd... yes, shared
checking whether to disable compressed protocol support in mysqlnd... yes
checking for the location of libz... no
checking for DSA_get_default_method in -lssl... no
checking for X509_free in -lcrypto... yes
checking for pkg-config... /usr/bin/pkg-config

更新

找到 an entry在 bugs.php.net 上描述了 mysqlndconfigure 文件的问题,也许这可能是相关的。

最佳答案

对于遇到此(或类似)问题的任何人,这里是我使用 phpbrew 在 Ubuntu 17.04 上安装 PHP 7.1 的一些发现。 .

我尝试使用 phpbrew 安装 php-7.1,如下所示:

phpbrew install 7.1 +default

无法找到 Openssl 库的报告失败,一些 github 问题和论坛建议改用以下内容:

phpbrew install 7.1 +default +mysql +openssl=/usr/local/openssl/

这也失败了,并显示与原始问题完全相同的错误消息:

Cannot find OpenSSL's <evp.h>

事实上这个文件可以在/usr/local/openssl 中找到,这使得情况更加奇怪。

我终于找到了 phpbrew 问题中建议的解决方案 111 :

 phpbrew install 7.1 +default +openssl=shared -- --with-openssl-dir=/usr/include/openssl

请注意 +openssl 现在表示 shared 并且 --with-openssl-dir 用于指示与之前相同的路径 /usr/include/openssl

关于php - 在 PHP 7.0.13 上安装 mysqlnd 时找不到 OpenSSL 的 <evp.h>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40804404/

相关文章:

php - 将用户重定向到 php 中的同一页面问题

php - 日期过后显示文本

php - 无法在 Windows 7 上安装 PHPUnit_Invoker

c - 将二维字符串数组传递给函数?

php - 以同一表单提交将第三个表中的外键插入到两个不同的表中

php - PDO php 中的一些查询正在执行,有些则没有

PHP 命令行持久连接

javascript - 如何在jquery中插入php脚本?

c - memset(&obj, 0, sizeof obj) 的可移植性是否不如使用 {0} 初始化?

使用##运算符创建宏