Home > Article > Operation and Maintenance > How to use yum to install lnmp environment in centos7
The following tutorial column of centos will introduce to you how to use yum to install the lnmp environment in centos7. I hope it will be helpful to friends in need!
Update yum source
yum update
yum install nginx
Install nginx latest sourceyum localinstall http://nginx. org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum repolist enabled | grep "nginx*"
Install nginxyum -y install nginx
Start nginx
| service nginx start
|
Set nginx server to start automatically after booting
systemctl enable nginx.service
Check whether the automatic setting at boot is successfulsystemctl list-dependencies | grep nginx
Use yum to install mysql5. 7
Install mysql sourceyum -y localinstall http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
yum repolist enabled | grep "mysql.*-community.*"
Install mysqlyum -y install mysql-community-server install mysql-community-devel
Start mysql
service mysqld start
Check whether mysql starts normallyservice mysqld status or
ps -ef | grep mysql
Set the mysqld service Auto-start at bootsystemctl enable ysqld.service
Check whether mysqld auto-start is set successfullysystemctl list-dependencies | grep mysqld
mysql5.7 In the future, the security mechanism will be strengthened, so use yum to install it. The system will automatically generate a random password at startup and change the mysql password; check the random password of mysqlgrep 'temporary password' /var/log/mysqld .log
Use the random password obtained from the query to log in at the terminal
mysql -u root -p Change password (mysql document stipulates that the password must include uppercase and lowercase letters and numbers plus special symbols > 8 digits)ALTER USER 'root'@'localhost' IDENTIFIED BY 'Yourpassword';
Exit the mysql client and log in with the password you just changed to ensure the password change is successfulexit;
mysql -u root -p
Install php7.1
Install php sourcerpm -Uvh https://dl.fedoraproject.org/pub/ epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
Check whether the source is installed successfullyyum repolist enabled | grep "webtatic*"
Install php extension sourceyum -y install php71w php71w-fpm
yum -y install php71w-mbstring php71w-common php71w-gd php71w-mcrypt
yum -y install php71w-mysql php71w-xml php71w-cli php71w-devel
yum -y install hp71w-pecl-memcached php71w-pecl-redis php71w-opcache
Verify whether php7.1.x and extensions are installed successfullyphp -v
Verify whether the corresponding extension is installed successfully
php -m
Set php-fpm and detect the running status of php-fpm
Start php-fpm: service php-fpm star
Check whether the startup is successful: service php-fpm status
Set the auto-start at boot: systemctl enable php-fpm.service
Check whether the auto-start is set successfullysystemctl list-dependencies | grep php -fpm
ps -ef | grep php-fpm
yum install rpms.remirepo.net/enterprise/remi-r...
yum search php74
The above is the detailed content of How to use yum to install lnmp environment in centos7. For more information, please follow other related articles on the PHP Chinese website!