Detailed configuration pit wordpress

After my first test, php74 module does not support the apache so after upgrading to php74, php can not use the most basic function phpinfo call does not come out, no relevant module.
Found that 10.4 after installation mariadb, mariadb this version seems not to support password ( anyway, I did not get a day). change the configuration of what I have tried, still free secret landing. so after I tested last day of the program is to determine php72 + mysql8.0 (still encountered a lot of problems, including mysql and mariadb version conflict, conflict module configuration conflicts, and, php, in order not to waste time trying to change the configuration, the system is about five times I reinstall the practice of blood and tears)
to start following the right steps, first install mysql warehouse, from Download the official repository file, or get the link to the server using wget way

After https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm wget download and install via the local
yum localinstall package

Refresh warehouse yum clean all

Rebuild cache yum makecache

After installing mysql yum install mysql (be sure to install mysql install php module can not find the time or else to support, install the MySQL, convenient automatic identification module version. Otherwise, the wrong version of that time, something to roll back a long time, and then clean configuration , appear inexplicable error)

After installing, enter the mysql password is required at this time. But you did not set a password, but where's the password? This is a higher version of MySQL features, it will generate a random password
after you mysql-uroot -p password required output, determine after no password prompt, and then view the MySQL log cat var / log / mysqld.log | grep password you can see the generated random password (can not find many landing several times) refresh

Then mysql-uroot -p get random password. Log in, you must reset your password immediately

alter user 'root' @ 'localhost'IDENTIFIED BY' YourNewPass'; -> mysql8.0 relatively strict password rules, requests for account with case, the digital symbol length is 8, after all of the default password several options back twice to confirm Yes

End reset your password, create a new database wordpress

create database wordpress ; \q 退出.

Install php -.> High because there is no official version of the source seems to only 5.4, the lowest wordpress to 5.6 or higher was it, anyway, no warehouse Ali cloud, others are not.

Installation php72w, is the need to configure additional yum source address, otherwise it will error can not find the package.

yum version of php high source address has two parts, part of which is epel-release, from other part webtatic. If you skip epel-release, then the installation webtatic, there will be an error burst.

Therefore, the command is needed here:

rpm -Uvh https://dl.Fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

Of course, you can also select the following command, the effect is the same.

yum install epel-release -y

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

Remember to rebuild the cache after updating the source
yum Clean All
yum makecache

If you have previously had installed php php in order to prevent conflicts CentOS above, so this command is executed first look better.
Clear History version
yum -y remove php *
install the expansion pack

In fact, there's a lot of correspondence extensions, here we must pay attention to cli fpm and two packages, while others need to see the related packages.

yum -y install php72w php72w-cli php72w-fpm php72w-common php72w-devel

This is preferably mounted
yum -y install php72w php72w-cli php72w -fpm php72w-common php72w-devel php72w-embedded php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml

After installation is complete, start the service
systemctl enable php-fpm.service set boot

systemctl start php-fpm.service to start php-fpm

And then begin installing apache

httpd install yum
systemctl enable httpd
systemctl Start httpd
this time the visit will have access to the standard apache test page
and then enter the web directory / var / www / html
to create a new php file to test
vim index.php add test code
<? php
phpinfo () ;
?>

After save and exit, access address, if php version information page appears stating php link success.
Can begin the next step.
Download wordpress, after wge download extract.
Create a website root directory webroot / wordpress
will move all unzipped wordpress to this folder

Again the virtual host configuration
vim /etc/httpd/conf.d/vhosts.conf
add code to
<VirtualHost *: 80>
ServerName website address
ServerAlias Alias website address
DocumentRoot "/ webroot / blog" // just create a new folder

<Directory "/webroot/blog">
Require all granted

Save and exit, then restart httpd

Access server address, preferably after configuring virtual hosts, and through before I have said is, write a php test page to see the virtual host can access the php success, success can safely begin the next step.

Into the relevant pages. Configuration page. Tip a database link name, account, password, enter the database information we have just set up, this time the problem came, found that in any case can not be written, suggesting a problem with the database. (OK Password What's no problem.)

In fact, this is because I used the high version of mysql8.0, before the default security policy is not to change your password after external access. And authentication methods required by the server to the client is unknown. Tip authentication server (database to be connected) is required caching_sha2_password.
Open phpinfo (), view the configuration php version currently installed, locate mysqlnd.

The current version of PHP brought mysqlnd not support this verification (caching_sha2_password), and the default PHP is mysql_native_password.
MySQL root to log in, and view the database as the default authentication
select host, user, plugin from mysql.user where user = 'root';

Solution:
MySQL support mysql_native_password create a user authentication and use the user login management wp_database database.

Creating a user authentication method is mysql_native_password

create user 'your account' @ 'localhost' identified with mysql_native_password by 'your password';

To create wordpress store data in the database, specify the character set

create database wp_database default charset utf8 collate utf8_general_ci;

All rights wp_database to your user account

. Wordpress grant all on database name created * to 'account you just created' @ 'localhost';

Then refresh the website you can visit a success.

If that does not work,

Modify the configuration
1, after the board into MySQL,

2, enter the following statement into mysql database:

use mysql

3, update the field attribute '%' means allow external access:

update user set host='%' where user ='root';

4, after the execution of the above statement then execute:

FLUSH PRIVILEGES;

5, and then perform authorization statement:

GRANT ALL PRIVILEGES ON . TO 'root'@'%'WITH GRANT OPTION;

Then you can access through the external account password.

)

Guess you like

Origin www.cnblogs.com/thelovelybugfly/p/12289494.html