Ubuntu12.04 build a PHP environment (MySQL + PHP + Apache environment)

Source: Internet
Author: User
Blog.sina.com.cnsblog_3f6b8ac001015arb.html 2. Switch administrator identity sudosu3. start installing mysql5apt-getinstallmysql-servermysql-client requires entering the root user password 1234564. If the installation apache2apt-getinstallapache2 is successful, open localhost should

Http://blog.sina.com.cn/s/blog_3f6b8ac001015arb.html 2. switch the Administrator identity sudo su 3. start installing mysql5 apt-get install mysql-server mysql-client. You must enter the root user password 123456. if apache2 apt-get install apache2 is successfully installed, enable http: // localhost/

Http://blog.sina.com.cn/s/blog_3f6b8ac001015arb.html

2. Change the Administrator identity

Sudo su

3. start installing mysql5

Apt-get install mysql-server mysql-client

Enter the root user password 123456

4. Install apache2

Apt-get install apache2

Http: // localhost/

The following url should be displayed:


It works!

This is the default web page for this server.

The web server software is running but no content has been added, yet.


5. Install php5

We can directly install the php5 and apache php5 modules as follows:

Apt-get install php5 libapache2-mod-php5

Restart After installation

/Etc/init. d/apache2 restart


6. Test php5 and obtain the php5 Installation DetailsInformation

By default, the root directory of the website file is under/var/www.

First

Chmod 777/var/www/

Get Permissions

Create the info. php file in the system file/var/www/and write it in it.

phpinfo()

?>


Open this URL and you will be able to detect it.


7. php5 is supported by mysol

For php to be supported in mysql, we can install the php-mysql software package. It is a good idea to install some other php5 modules and applications you may need:

apt-cache search php5

You also need to install

apt-get install php5-mysql php5-curl php5-gd php5-idn php-pearphp5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-psphp5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpcphp5-xsl

Restart apache2 now:

/etc/init.d/apache2 restart


8. Install phpmyadmin

Phpmyadmin is a network interface that can be used to manage your mysql database.

apt-get install phpmyadmin

It is automatically installed under/usr/share/phpMyAdmin,

Copy phpMyAdmin to the/var/www directory,

Run http: // localhost/phpmyadmin/

Enter root and 123456 to log on.


9. pseudo-static

http://www.tuesdays.cn/2012/03/ubuntu-1004-lts-to-open-a-pseudo-static-rewrite/


Command: sudo a2enmod rewrite

Modify the/etc/apache2/sites-available/default file.

Options FollowSymLinks
AllowOverride None (change to AllowOverride All)


Options Indexes FollowSymLinks MultiViews
AllowOverride None (change to AllowOverride All)
Order allow, deny
Allow from all


I don't know how to modify this type of configuration file 777 faster. It seems that the input is invalid.

sudonautilus

Go in and modify it.

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.