Configuration and installation of LAPP (Linux + Apache + PostgreSQL + PHP) Environment in Ubuntu

Source: Internet
Author: User
1 installation apache2sudoapt-getinstallapache2 installation is complete, run the following command restart: sudo/etc/init. d/apache2restart: Enter http: // localhost or http: // 127.0.0.1 in the browser. If you see "Itworks! & Ldquo;, it indicates that Apache is successfully installed. The default installation of Apache 1 is apache2.

Sudo apt-get install apache2

After the installation is complete, run the following command to restart:

Sudo/etc/init. d/apache2 restart

Enter

Http: // localhost or http: // 127.0.0.1

If you see "It works! ", It means that Apache is successfully installed. By default, Apache will create a directory named www under/var. This is

The Web directory. All Web files that can be accessed through a browser must be put in this directory.

2. install php

Sudo apt-get install libapache2-mod-php5 php5

We recommend that you install the PDO extension:

(1) For mySQL database installation extension:Sudo apt-get install php5-gd php5-mysql

(2) For PostgreSQL database installation extension:Sudo apt-get install php5-gd php5-pgsql

 

(Note: The PDO extension defines a lightweight and consistent interface for PHP to access the database. It provides a data access abstraction layer, so that no matter what database is used, you can use consistent functions to query and obtain data)

 

After installation, restart Apache to load the PHP module:

Sudo/etc/init. d/apache2 restart

Next, create a PHP file under the Web directory to test whether PHP can run normally. type the following command:

Sudo gedit/var/www/phpinfo. php

Then enter:

Phpinfo ();

?>

Save the file and enter http: // 127.0.0.1/phpinfo. php In the browser. If a page displays the PHP running parameters, it indicates that PHP is running properly.

If you want to check whether the PDO extension of the corresponding database is successfully installed, go to the http: // 127.0.0.1/phpinfo. php page and find "pdo" if it is shown as follows:

The PDO of PostgreSQL is successfully installed! If PDO drivers has mysq, it indicates that mySQL's PDO is successfully installed!

Related Article

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.