Tutorial on installing php5+pdo_PHP under ubuntu
Jul 15, 2016 pm 01:22 PM
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

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

CUDA's universal matrix multiplication: from entry to proficiency!

Huawei's Qiankun ADS3.0 intelligent driving system will be launched in August and will be launched on Xiangjie S9 for the first time

Four recommended AI-assisted programming tools

How to install Angular on Ubuntu 24.04

Which AI programmer is the best? Explore the potential of Devin, Tongyi Lingma and SWE-agent

Android TV Box gets unofficial Ubuntu 24.04 upgrade
