Mysql extension module of php in ubuntu
The php and nginx environments have been set up before. However, php has not yet integrated mysql. No database or anything. The holiday starts when you are at home in the afternoon.
Start a Google Tour ~
Pitfall 1: First find the semicolon before/usr/local/lib/php. ini; extension = php_mysqli.dll; (comment. Enable the mysql module. But later I saw that it was a configuration in windows. I did not carefully read the document .. Cry. I used to skip the English section! Pit2: Google needs to install the mysql connection plug-in for php on my computer: So we have the following command:
Sudo apt-get install php5-mysql php5-curl php5-gd php5-intl php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode
An error has been reported since execution, which roughly means that the installation of the php5-imagick is incorrect. Terminal display:
E: Sub-process/usr/bin/dpkg returned an error code (1) bug .. What is it when I go here. Google said it was probably caused by installation with apt-get install. So I used Google to solve this problem again .. However, it seems that it has nothing to do with my purpose.
Trap 3: Google again with a tragic mood. In general, let me compile mysql. so in the php installation directory (I installed it through the source code. It takes effect after configuring php. ini.
When I do this in the php installation directory
Cd ext/mysql
/Usr/local/bin/phpize
./Configure-with-php-config =/usr/local/bin/php-config-with-mysql =/usr/local/mysql/
Error-with-mysql = the path following does not exist.
I changed it to-with-mysql without setting the address. Let the kernel automatically search.
Another error occurs.
ubuntu ext/mysqlnd/mysqlnd.h:No such file or directory
What is this! How can this make the old man better!
Finally! Make a big move. Uninstall php and run sudo make distclean in the php installation directory./configure -- enable-sockets = shared -- with-mysql = shared, mysqlnd -- enable-fpmmakemake install. Write the mysql access code in php!
But I am still confused about this. Now we can only let it run first. Learn more later.