Nginx-about PHP and MySQL extension library

Source: Internet
Author: User
Tags php and mysql
To use in PHP mysql_connect()function, you need to turn on php_mysqlLibrary

However, when compiling PHP, the following parameters are very puzzled:

    • --with-mysql=mysql Client Connection Library
    • --with-mysqli=mysql Client Connection Library
    • --with-pdo-mysql=mysql Client Connection Library

"--with-mysql=mysql Client Connection Library" Why do you write this, the Php_mysql library, the php_mysqli library is provided by PHP, or is generated by the MySQL Client connection library?

Reply content:

To use a function in PHP mysql_connect() , you need to open php_mysql the library,

However, when compiling PHP, the following parameters are very puzzled:

    • --with-mysql=mysql Client Connection Library
    • --with-mysqli=mysql Client Connection Library
    • --with-pdo-mysql=mysql Client Connection Library

"--with-mysql=mysql Client Connection Library" Why do you write this, the Php_mysql library, the php_mysqli library is provided by PHP, or is generated by the MySQL Client connection library?

PHP's Mysql/mysqli library is just a simple package for the C API of MySQL, and does not include the implementation of the C API, it relies on libmysqlclient.so and related header files, so it needs to be in the same path as it was compiled.

--with-mysql=[Path] The path here is the path specified by--prefix when compiling MySQL, which should contain the include and Lib two directories, which will contain the above files.

The MySQL client library is used to connect to the MySQL server. PHP's MySQL extension library is for PHP to be able to invoke the MySQL client library.

Libraries are used for linking, not for generating other libraries.

  • Related Article

    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.