Home > Backend Development > PHP Tutorial > Tutorial on installing php5+pdo_PHP under ubuntu

Tutorial on installing php5+pdo_PHP under ubuntu

WBOY
Release: 2016-07-15 13:22:34
Original
967 people have browsed it

In the past few days, I have tried to move my work machine to ubuntu for development. After the system is installed, the first task is to install the php+mysql development environment. I plan to install php5 and pdo_mysql directly. The following is a record of the installation process

First, I directly installed apache2, php5, pear and mysql5 using apt-get. In order to facilitate subsequent installation, I also added 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

It seems that pdo can’t find the installation source in ubuntu’s apt , so it is very simple to install this extension through pecl - if the submarine optical fiber can be connected:

pecl install pdo

Add a line:

extension=pdo.so

To the file:

/etc/php/apache2/php.ini

/etc/php/cli/php.ini

Next install pdo_mysql When encountering some problems, some errors will appear when running pecl install pecl_mysql directly. After searching, I found that it is a problem with pecl itself. Here 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 whether it is installed For the code snippet of pdo extension, continue to run:

phpize

./configure

make

make install

and then add the following again Go to the two php.ini mentioned earlier in one line

extension=pdo_mysql.so

After restarting apache, php5 + pdo_mysql is installed on ubuntu, and the documentroot is /var/www

Postscript

A simpler solution is to run:

PHP_PDO_SHARED=1 pecl install pdo_mysql


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/446976.htmlTechArticleIn the past few days, I have tried to move the working machine to ubuntu for development. After the system is installed, the first task is to install php +mysql development environment. I plan to install php5 and pdo_mysql directly. The following is the installation process...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template