Quick configuration of PHP environment in Ubuntu

Source: Internet
Author: User
Ubuntu PHP environment quick configuration installation Apache2: sudoapt-getinstallapache2 install PHP module: sudoapt-getinstallphp5 edit test page :() sudogedit/var/www/testphp. php install Mysqlsudoapt-getinstallmysql-servermysqladmin

Quick configuration of PHP environment in Ubuntu

Install Apache2:

Sudo apt-get install apache2

Install the PHP module:

Sudo apt-get install php5

Edit test page :()

Sudo gedit/var/www/testphp. php

Install Mysql

Sudo apt-get install mysql-server

Mysqladmin-u root-p password Change password

Install the Mysql Module

Sudo apt-get install libapache2-mod-auth-mysql

Sudo apt-get install php5-mysql

Sudo apt-get install php5-gd

Sudo/etc/init. d/apache2 restart

Configure php. ini:

Sudo gedit/etc/php5/apache2/php. ini

Put the file behind the file:

# Extension = mysql. so

# Extension = gd. so

.

Install phpmyadmin

Sudo apt-get install phpmyadmin

Test: htt p: // localhost/phpmyadmin/

Map URLs to other directories

Sudo gedit/etc/apache2/conf. d/alias

Restart apache

Sudo/etc/init. d/apache2 restart

======================================

Phpmyadmin is not installed under/var/www by default, but in/usr/share/phpmyadmin

You can copy phpmyadmin or create a link and copy the link.

Run sudo gedit/etc/phpmyadmin/apache in the terminal. conf and change the path of the following two sentences to/var/www/phpmyadmin (because I have configured the environment, I forgot how to write the default configuration in phpmyadmin .. There are two sentences in the third and fourth rows. If I remember correctly, it should be as follows)

Alias/phpmyadmin/usr/share/phpmyadmin

Changed:

Alias/phpmyadmin/var/www/phpmyadmin

1. Restart apache

Sudo/etc/init. d/apache2 restart

2. Restart mysql

Sudo/etc/init. d/mysql restart

Now that the LAMP environment is successfully configured, try echo phpinfo!

======================================

Apache configuration file path/etc/apache2/apache2.conf

Php. ini path/etc/php5/apache2/php5.ini

Mysql configuration file path/etc/mysql/my. cnf

Phpmyadmin configuration file path/etc/phpmyadmin/apache. conf

Website root directory/var/www

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.