Home  >  Article  >  Backend Development  >  Apache php mysql installation under Tencent Cloud Server Linux system

Apache php mysql installation under Tencent Cloud Server Linux system

WBOY
WBOYOriginal
2016-07-28 08:26:091195browse

Apache php mysql installation under Tencent Cloud Server Linux system

CentOS system we can directly use yum install to install the software. Tencent Cloud provides software installation source, which is
Synchronize the official installation source of CentOS. The included software is the most stable version at present, so you can install it directly.

1. Install apache php mysql

yum install -y httpd php php-fpm mysql mysql-server php-mysql

 腾讯云服务器linux系统下apache php mysql安装

2. Start the corresponding services

The apache php mysql software we installed are all in the server in the form of services. Note that I usually
The web service we are talking about refers to apache, not the server itself

service httpd start
service mysqld start
service php-fpm start

 腾讯云服务器linux系统下apache php mysql安装

After entering these three commands, it means that the website environment has basically been completed. Next, execute netstat -tunlp to check
Check the running status of the service

 腾讯云服务器linux系统下apache php mysql安装

This way we can see that httpd (that is, the apache service) listens to port 80, mysql listens to port 3306, php-
fpm listens to port 9000 and has started normally

At this time, our environment has been basically set up, and everyone can already access the server’s external IP in the browser,
If you can see the apache test page, it means you have succeeded. For the sake of safety, it is also recommended that everyone enter
Go to the web root directory of apache: /var/www/html and write the simplest php page yourself.

3. Simple configuration of mysql

We need to set up the corresponding user for mysql to access management. We have already started it before mysqld service, so
At this time we need to set an initial root password for mysql, so that the root user can access the database

mysqladmin -u root password "XXXXXXXX"

In this way, we have set the password for mysql. You can enter mysql -u root - p, then enter just
After setting the password, you can enter the database

 腾讯云服务器linux系统下apache php mysql安装

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above has introduced the installation of apache php mysql under Tencent Cloud Server Linux system, including the relevant contents. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn