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