Install Apache, Mysql, and PHP in CentOS6

Source: Internet
Author: User
Tags install wordpress
Install Apache, Mysql, and PHP in CentOS6. 1. install Apache

Enter the following command in the terminal to install Apache:

sudo yum install httpd

Sudo indicates what operations are performed by the root user. Click y to download and install it, which is very convenient.

Run the following command to start the service:

sudo service httpd start

Now you don't have to worry about it. simply enter the IP address that DigitalOcean gave you in your browser and you will be able to access the Apache welcome page. Similar to the following:


Is it cool? If your domain name has been successfully resolved to the IP address of your host, you should be able to access it with your domain name!


2. install Mysql

sudo yum install mysql-serversudo service mysqld start

Use the following command to download and install mysql. The second one is to start the mysql service.

After installing mysql, you will be asked about some simple configurations. press enter first. the following English is actually very simple. you can choose one based on your needs.

Disallow root login remotely? There is such an option: whether to allow remote access by the mysql root user. I chose no to allow remote access, which is more convenient, but there is a security risk. In this case, you can also use the database in the VPS.


3. install PHP and PHP components

sudo yum install php php-mysql

Use the above command to download and install PHP. It is troublesome to use PHP components.

yum install php-gd php-imap php-ldap php-odbc php-pear php-xml  php-xmlrpc

I have installed seven simple components here. you can also search for all PHP components and use the following command

yum search php-

4. start Apache and Mysql services by default.

sudo chkconfig httpd onsudo chkconfig mysqld on

You can use the preceding two commands to start Apache and Mysql at startup.


5. test whether PHP is successfully installed.

sudo nano /var/www/html/info.php

You can use the following command to create a new info. php file. nano is a simple text editing tool and vim.

Enter a simple PHP test command:

 

Then press Ctrl o to save the settings and press enter to confirm. Press Ctrl x to exit.

In the browser, enter the IP address and add info. php to view the PHP information! Similar to the following figure:


I'm so excited to install Wordpress.


Reference;

Install Apache, Mysql, and PHP in CentOS 6

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.