Example of adding an extension library for PHP in Linux: adding an extension library for mbstring
1. go to the PHP source code directory (if there is no source code, run the command: # php-v to view the version number, and then download the source code from the PHP official website)
2. go to the FTP Extension Library Directory under PHPi source code:
# Cd [Your PHP Source Folder]/ext/mbstring
3. use the phpize command to generate the configuration file:
# Phpize
4. execute configure:
#./Configure -- with-php-config =/usr/local/php/bin/php-config (the following path corresponds to the php-config directory on the local machine)
5. if no error is reported, run make:
# Make
6. after make is successful, the generated extension library file is in the modules subdirectory of the current directory. In this exampleMbstring. so, Copy this file to "/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/" (corresponding to the PHP Directory of the local machine)
7. modify/etc/php. ini, add a line under [mbstring]: extension = mbstring. so, and save
8. restart the apache or nginx server (if it is useful to the amh panel, you need to use the command to make it take effect: # amh php stop [Your Host] and # amh php start [Your Host])