mysqli extension installation of PHP under Linux

Source: Internet
Author: User

In the past has been developed under the environment of WAMP, rarely contact lamp development, now the company needs to use the lamp environment, the next need to learn more about the environment.
Today in the original php5.3 on the basis of upgrading to php5.4 version, need to make some changes to the environment, which involves the configuration of the PHP module, Wamp directly in the php.ini to enable mysqli on the line (remove; extension=php_ Mysqli.dll in front of the semicolon ";" ), but the Linux environment does not have to do so, but also to add their own mysqli extension files, I take the addition of mysqli as an example to record.
First to the PHP installation package (I use the source code compiled installation) below, there is a file called ext,
Go to the file: cd ext
Use: ls command to see that there are some extensions below,

If there is no expansion below you need to go to the Internet to download. Fortunately, there is a mysqli extension package that I need, and then go to the mysqli file: cd mysqli
Next need to use the Phpize (Phpize is used to extend the PHP extension module, through the phpize can build PHP plug-in module, a detailed explanation on the Internet, there is interested to know can go to degree Niang).
Direct Input phpize

If that doesn't work, you can use: find / -name phpize command to check the location of Phpize,
, and then use /usr/local/bin/phpize ,

Next Use this:

.-prefix=/usr/local/mysqli
make
install

With these three commands, make install a directory file is generated after the usage is complete:
Use ls view this directory to see a. So end of the file mysqli.so, equivalent to a. dll file under Windows,

Then use: service httpd restart command Restart under the service is OK!
Using Phpinfo () in the program, you can see the contents of the mysqli extension:

mysqli extension installation of PHP under Linux

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.