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

时间:2016-11-25 11:50:47

标签: php c pdo php-7 mysqlnd

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

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

已经尝试过这些:

仍然遇到同样的错误。

./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

更新

在bugs.php.net上找到an entry,说明了mysqlnd configure文件的问题,也许这可能是相关的。

1 个答案:

答案 0 :(得分:2)

对于遇到此(或类似)问题的人,我的一些调查结果是使用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/

与原始问题完全相同的错误消息也失败了:

  

找不到OpenSSL&#39;

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

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

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

请注意,+ openssl现在说共享,而--with-openssl-dir用于表示与 / usr / include / openssl