Build the ubuntuphp environment

Source: Internet
Author: User
Build the ubuntuphp environment 1. install apache

Sudo apt-get install apache2

Modify the path of the default website root directory Apache's first configuration file apache2.conf

/Etc/apache2/apache2.conf

 

Path of the second Apache configuration file 000-default.conf

/Etc/apache2/sites-available/000-default.conf

Change the path to/var/www/

DocumentRoot /var/www/html

2. install php5

Sudo apt-get install php5

3. installing pdo mysqlPDO (PHP Data Object) is a new database processing method of PHP 5. due to the conflict between php License and myslq license, PHP may not be bound to mysql in subsequent versions. Php_mysql.dll may not be supported by default. Pdo is a pecl.php.net project. you can use pear to install pdo first.

Apt-get install php-pearsudo apt-get install php5-devsudo apt-get install libmysqlclient15-dev

Then you can install pdo.

Pecl search pdosudo pecl install pdo_mysql

The following error is reported:

The above indicates that the pdo_mysql driver cannot be found in pear, and the php5-mysql needs to be reinstalled

Sudo apt-get install php5-mysql

After the installation is successful, the system runs normally. Although we seem to have installed the php5-mysql in apt, but here you still need to install again finally, modify

/Etc/php5/apache2/php. ini

Add Code

extension=pdo.soextension=pdo_mysql.so

In this way, you can connect to mysql through php5.

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.