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

王林
Release: 2023-03-11 08:44:01
Original
2532 people have browsed it

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
Copy after login

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
Copy after login

Restart the service

>service php-fpm restart
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!