I use ubuntu20.04, and the relevant php dependency package is 7.4
The php dependency package I installed is as follows:
root@Desktop:/home/appleyuchi# dpkg --list|grep php
Dependent package name | version number | Supported hardware architecture | Dependent package description |
---|---|---|---|
php-common | 2:75 | all | Common files for PHP packages |
php-fpm | 2:7.4+75 | all | server-side, HTML-embedded scripting language (FPM-CGI binary) (default) |
php-gd | 2:7.4+75 | all | GD module for PHP [default] |
php-mysql | 2:7.4+75 | all | MySQL module for PHP [default] |
php7.4-cli | 7.4.3-4ubuntu2.3 | amd64 | command-line interpreter for the PHP scripting language |
php7.4-common | 7.4.3-4ubuntu2.3 | amd64 | documentation, examples and common module for PHP |
php7.4-fpm | 7.4.3-4ubuntu2.3 | amd64 | server-side, HTML-embedded scripting language (FPM-CGI binary) |
php7.4-gd | 7.4.3-4ubuntu2.3 | amd64 | GD module for PHP |
php7.4-json | 7.4.3-4ubuntu2.3 | amd64 | JSON module for PHP |
php7.4-mysql | 7.4.3-4ubuntu2.3 | amd64 | MySQL module for PHP |
php7.4-opcache | 7.4.3-4ubuntu2.3 | amd64 | Zend OpCache module for PHP |
php7.4-readline | 7.4.3-4ubuntu2.3 | amd64 | readline module for PHP |
So different ubuntu has different php dependency package versions, don't copy mine, make corresponding modifications according to your own version number
Browser access | Webpage error | /etc/nginx/error.log reports an error | solution |
---|---|---|---|
http://localhost:80/wp-admin/install.php | 502 | connect() to unix:/var/run/php/php7.1-fpm.sock failed (2: No such file or directory) | /var/run/php/php7.1-fpm.sock in nginx.conf;/var/run/php/php7.4-fpm.sock and then nginx -s reload |
After logging in | 404 | [error] 500558#500558: *127 “/usr/share/nginx/html/wp-admin/index.php” is not found (2: No such file or directory), client: 127.0.0.1, server: localhost, request: “GET /wp-admin/ HTTP/1.1”, host: “localhost”, referrer: “http://localhost/wp-login.php” |
Do you need a compiled version of nginx?
In addition, there are bloggers on the Internet that they need to compile nginx by themselves.
This is available or not, we just use our own.
File Structure
(Python3.6) appleyuchi @ Desktop: ~ / LS WordPress $
hello.php WP-ADMIN cron.php WP-WP-settings.php
...
...
nginx file
corresponds to the complete /etc/nginx/nginx.conf
server {
listen 80;
listen [::]:80;
server_name localhost;
root /home/appleyuchi/wordpress;
#location /
#{
#try_files $uri $uri/ /index.php?$query_string;
#}
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ \.php$
{
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
#location /wp-includes {
#root /home/appleyuchi/wordpress/wp-includes;
#autoindex on;
# }
}