Home  >  Article  >  Backend Development  >  How to compile mysqlnd extension separately in php?

How to compile mysqlnd extension separately in php?

WBOY
WBOYOriginal
2016-07-06 13:51:411968browse

I have been playing around with php recently and downloaded php 7.0.8

Only php-fpm was enabled during compilation

<code>./configure --prefix=/usr/lcoal/php --enable-fpm
</code>

I want to add various extensions through phpize, but I encountered problems with mysql support
After executing phpize in the ext/mysqlnd directory and generating configure
When ./configure, it first prompts that it cannot be found A header file of openssl:

<code>configure: error: Cannot find OpenSSL's <evp.h>
</code>

Manually modified the variables in the configure script:

<code>OPENSSL_INCDIR=/usr
OPENSSL_LIBDIR=/usr/lib64</code>

Finally compiled successfully, add

in php.ini
<code>extension=mysqlnd.so</code>

or

<code>zend_extension=mysqlnd.so</code>

Cannot be loaded

Please tell me, mysqlnd and fpm can only be added in configure when compiling php for the first time?

Reply content:

I have been playing around with php recently and downloaded php 7.0.8

Only php-fpm was enabled during compilation

<code>./configure --prefix=/usr/lcoal/php --enable-fpm
</code>

I want to add various extensions through phpize, but I encountered problems with mysql support
After executing phpize in the ext/mysqlnd directory and generating configure
When ./configure, it first prompts that it cannot be found A header file of openssl:

<code>configure: error: Cannot find OpenSSL's <evp.h>
</code>

Manually modified the variables in the configure script:

<code>OPENSSL_INCDIR=/usr
OPENSSL_LIBDIR=/usr/lib64</code>

Finally compiled successfully, add

in php.ini
<code>extension=mysqlnd.so</code>

or

<code>zend_extension=mysqlnd.so</code>

Cannot be loaded

Please tell me, mysqlnd and fpm can only be added in configure when compiling php for the first time?

  1. openssl cannot be found. PHP itself does not have ssl extension. You need to install ssl extension first

  2. No need to modify the configure file

  3. Theoretically all extensions can be dynamically compiled or added later

You can add extensions later, just don’t need make install

I think you need to install the openssl extension first and then compile it according to some auxiliary methods provided in the configure help. openssl installation method
Then you can install the mysqlnd extension similarly

Both extensions have a prerequisite. If you want to install the ssl extension, you must first install openssl. If you want to install the mysqlnd extension, you must first install mysql

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn