PHP-study notes-deploy wordpress

Preparation

The versions of wordpress and php need to match

https://make.wordpress.org/core/handbook/references/php-compatibility-and-wordpress-versions/

Insert image description here
As above, if you already have php in your computer and don’t want to change it, you need to download the corresponding wordpress according to the php version.
Otherwise, when you access it, you will be prompted that the php version is too low to access.

Matching of apache and php

one

My tool for deploying projects is apache.
If apache wants to use php, you need to open the php-related configuration first.
For example, you need to find the php_apache.dll script in php.ini and turn off the comments.
注意
If you need apache to cooperate with php, remember when downloading php. Download the thread-safe version, otherwise there will be no php_apache.dll file in the file, causing apache to be unable to recognize PHP scripts/codes properly.

two


The extension_dir="ext" line of code needs to be opened in php . It is recommended to fill in the absolute path of ext in quotation marks to ensure correctness
. The purpose of opening this line of code is to allow php to connect to mysql normally.

Matching of php and mysql

After downloading php, you can use the phpinfo method to check whether mysql is connected normally.
Generally, it is not connected by default. You need to enable the ext access path above and the phpmysqli.dll file in php's ext.
Then fill in extension=php_mysqli.dll in the php.ini file.

msyql

You need an account password and database name to access the database. You can create a new user to access the database and give basic permissions.

apache

Open httpd.conf in apache/conf
and turn off the comments of the virtual host, then enter http_vhosts.conf in apache/conf/extra.
Remember to bind the port number you need (do not be occupied, not 6666, the reason will be later Say)
Copy the downloaded WordPress path to vhots.conf, then save it and restart the apache
command

httpd -k restart

official use

After the above work is completed, start apache
, open the browser and access localhost: the port number you set.
Then log in according to the account password and database name created by mysql earlier, and then you can use wordpress.

Precautions

Try not to use common port numbers for apache. For example,
port numbers like 6666 can be accessed normally in the 360 ​​browser, but in browsers such as edge and chrome, it will prompt an inaccessible problem. The specific reason is not yet known. It can be said to be a pitfall.
Other projects deployed using port numbers similar to 6666 can be accessed normally. It may be caused by wordpress or other problems.

Guess you like

Origin blog.csdn.net/pure81/article/details/132835010