Install Php5+pdo under Ubuntu

Source: Internet
Author: User
Tags ini mysql pear

These days to try to move the machine to Ubuntu to do development, the system installed after the first task is to install the Php+mysql development environment. I intend to install php5 directly, Pdo_mysql, the following is the record of the installation process

First I installed the apache2,php5,pear and MYSQL5 directly with Apt-get, in order to facilitate the subsequent installation, plus make and libmysqlclient

sudo apt-get install Apache2-mpm-prefork

sudo apt-get install php5

sudo apt-get install Php5-dev

sudo apt-get install Php5-pear

sudo apt-get install mysql-server-5.0

sudo apt-get install make

sudo apt-get install Libmysqlclient15-dev

PDO does not seem to be able to find the installation source in Ubuntu's apt, so installing the extension via PECL is very simple-if the undersea fiber is connected:

PECL Install PDO

Add one line:

Extension=pdo.so

To file:

/etc/php/apache2/php.ini

/etc/php/cli/php.ini

Next install Pdo_mysql encounter some problems, run directly pecl install Pecl_mysql will appear some errors, search for the discovery is the problem of the PECL itself, the following is a relatively simple solution:

wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz

Tar xzvf pdo_mysql-1.0.2.tgz

CD pdo_mysql-1.0.2

Comment out configure to determine if the code fragment for the PDO extension has been installed, continue running:

Phpize

./configure

Make

Make install

Then add the following line again to the two php.ini mentioned earlier

Extension=pdo_mysql.so

After restarting Apache, PHP5 + pdo_mysql is installed on Ubuntu, DocumentRoot is/var/www

Postscript

A simpler solution is to run:

php_pdo_shared=1 pecl Install Pdo_mysql



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.