Install php5+pdo_php Tutorial under Ubuntu

Source: Internet
Author: User
Tags pear
These days try to move the machine to Ubuntu to do development, the first task after the installation of the system 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 the Ubuntu apt, so installing this extension via pecl is very simple-if the submarine fiber can connect:

PECL Install PDO

Add a line:

Extension=pdo.so

To file:

/etc/php/apache2/php.ini

/etc/php/cli/php.ini

Next install Pdo_mysql encounter some problems, directly run Pecl install Pecl_mysql will appear some errors, search the discovery is pecl itself problem, below 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 the code snippet in configure to determine if the PDO extension has been installed and 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


http://www.bkjia.com/PHPjc/446976.html www.bkjia.com true http://www.bkjia.com/PHPjc/446976.html techarticle these days try to move the machine to Ubuntu to do development, the first task after the installation of the system is to install the Php+mysql development environment. I intend to install the PHP5 directly, Pdo_mysql, the following is installed ...

  • 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.