How to install new modules in php

爱喝马黛茶的安东尼
Release: 2023-02-25 08:30:01
Original
3487 people have browsed it

How to install new modules in php

After php is installed, some modules may be missing during the initial installation, but we don’t want to recompile php because it takes a long time. Can we add a separate module to PHP without recompiling and installing PHP?

Related recommendations: "php Getting Started Tutorial"

Below we will take loading the mysqli module for php alone as an example to demonstrate how to dynamically add modules to php.

1. Find the php source code installation file

2. cd /home/php/ext/myslqi

3. Run /usr/local/php/bin/phpize

4./configure –with-php-config=/usr/local/php/bin/php-config

5. make && make install

6. Installation completed Afterwards, the mysqli.so library file will be generated in the system /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/ directory

7. Edit the php.ini file , specify php to the directory to read the module

vi /usr/local/php/etc/php.ini

extension_dir="/usr/local/php/lib/php/extensions/no -debug-non-zts-20060613″

extension=mysqli.so

8. Restart the php service/usr/local/php/sbin/php-fpm restart

9. /usr/local/php/bin/php -m|grep mysqli Check whether mysqli.so exists

The above is the detailed content of How to install new modules in php. 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