Add extension library for PHP in Linux-php Tutorial

Source: Internet
Author: User
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])

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.