Yum steps to install php environment: 1. Install nginx; 2. Install php; 3. Edit www.conf configuration file; 4. Start php-fpm and nginx; 5. Edit php.ini configuration file, Open the file upload function; 6. Configure the database.
The specific steps are as follows:
(Video tutorial recommendation: linux video tutorial)
The first step:
sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7 .ngx.noarch.rpm yum install php php-fpm php-mysql nginx mariadb-server -y yum install php-gd* -y
Step 2:
vi /etc/php-fpm.d/www.conf
Modify
The third step:
systemctl start php-fpm systemctl start nginx
If you need to enable the file upload function, please modify php.ini
vi /etc/php.ini upload_max_filesize = 100M
Simple configuration database
systemctl start mariadb
mysql_secure_installation Enter current password for root (enter for none): #Enter directly for the first run Set root password? [Y/n] #Whether to set the root user password, enter y and press Enter or press Enter directly New password: #Set the password of the root user Re-enter new password: # Enter the password you set again Remove anonymous users? [Y/n] # Whether to delete anonymous users, press Enter Disallow root login remotely? [Y/n] #Whether to prohibit root remote login, press Enter, Remove test database and access to it? [Y/n] # Whether to delete the test database, press Enter Reload privilege tables now? [Y/n] # Whether to reload the privilege table, press Enter
root user supports remote access
grant all privileges on *.* to & # 39; root & # 39; @ & # 39; % & # 39; identified by & # 39; 123456 & # 39; with grant option; flush privileges;