Linux practice--php5 compiling MySQL extensions

Source: Internet
Author: User

System ubutnu12.04-php 5.2

General steps:

Download the corresponding PHP version of the extension source

Unzip and enter the directory

Perform phpize precompilation (generic and PHP execution files in one directory)

./configure--with-php-config=php Path/php-config (If an error occurs installing autoconf)

Make && Makeinstall

Configuring the php.ini file to open the corresponding extension

Restart PHP Service (PHP-FPM or Apache)

——————————————————————————————

Lifting Li:

Now compile and install the MySQL extension, the phpize command is used to prepare the PHP extension library for the compilation environment. The source program for the extension library is in the Extname directory

$ cd extname$ phpize$./Configure --with-config -file-path= /php path/bin/php-config  --with-mysql --with-libdir= /lib/x86_64-linux-< Span class= "PLN" >gnu 
$ make
$ make install


mysql.so会自动添加extension_dir所指目录中,修改php.ini添加 extension=mysql.so 重启php


备注: ldconfig -v | grep mysql
缺少mysql apt-get install mysql-client
缺少头文件 apt-get install libmysqlclient-dev


Linux practice--php5 compiling MySQL extensions

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.