search
HomeBackend DevelopmentPHP ProblemWhat should I do if there is no extension library after php is compiled?

The solution to the problem that there is no extension library after php is compiled is to first enter the source code directory of php and execute the compile and installation command. Then add the pdo_mysql.so extension in the php.ini configuration file. Finally, execute the restart command.

What should I do if there is no extension library after php is compiled?

The operating environment of this article: centos 6.5 system, Nginx1.7&&PHP5.5&&MySQL5.6, thinkpad t480 computer.

Foreword:

There may be many extension libraries that have not been added when compiling php, but when we run the web program, we will find that many extension libraries need to be used.

So how should we solve this problem when we have already set up the LNMP environment and do not want to recompile and install it?

We can use phpize to install the extension library to add it. Let us take a look at the specific method below.

For example (php version 5.5.9, installation directory/usr/local/php5, source code directory/opt/softs/-php5.5.9, need to add support for pdo_mysql):

Enter PHP source code directory

>cd /opt/softs/php-5.5.9/ext/pdo_mysql
>/usr/local/php5/bin/phpize
>./configure –with-php-config=/usr/local/php5/bin/php-config –with-pdo-mysql=/usr/local/mysql/
>make && make install

After completion, the system prompts the directory where the pdo_mysql.so file is located (/usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212).

Modify php.ini and add a sentence

extension=/usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/pdo_mysql.so

Restart the service

>service php-fpm restart

Free learning video sharing:Programming video

The above is the detailed content of What should I do if there is no extension library after php is compiled?. For more information, please follow other related articles on the PHP Chinese website!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function