Mysql extension module _ MySQL in php under ubuntu

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

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.