Install php5 + pdo in ubuntu-Linux Enterprise Application-Linux server application information. For more information, see. In the past few days, I have tried to migrate the working machine to ubuntu for development. The first task after the system is installed is to install the development environment of php + mysql. 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 with apt-get. To facilitate subsequent installation, I also added make and libmysqlclient
Sudoapt-getinstallapache2-mpm-prefork
Sudoapt-getinstallphp5
Sudoapt-getinstallphp5-dev
Sudoapt-getinstallphp5-pear
Sudoapt-getinstallmysql-server-5.0
Sudoapt-getinstallmake
Sudoapt-getinstalllibmysqlclient15-dev
Pdo does not seem to be able to find the installation source in apt of ubuntu, so it is very simple to install this extension through pecl-if the submarine optical fiber can be connected:
Peclinstallpdo
Add a row:
Extension = pdo. so
To file:
/Etc/php/apache2/php. ini
/Etc/php/cli/php. ini
Next, I encountered some problems when installing pdo_mysql. Some errors may occur when I ran peclinstallpecl_mysql directly. I searched for the problem and found it was a problem with pecl. Below is a simple solution:
Wget
TarxzvfPDO_MYSQL-1.0.2.tgz
CdPDO_MYSQL-1.0.2
Comment out the code snippet in configure to determine whether the pdo extension has been installed and continue running:
Phpize
./Configure
Make
Makeinstall
Then add the following line to the two php. ini mentioned above.
Extension = pdo_mysql.so
After apache is restarted, php5 + pdo_mysql is installed on ubuntu, and documentroot is/var/www.
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.