nginx conf for PHP-FPM
-
Nginx file location: /etc/nginx/sites-available/default
server { listen 80; server_name yourdomain.com; root /var/www/html; index index.php; location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php8.1-fpm.sock; } }
Create new user on MySQL
CREATE USER 'user'@'localhost' IDENTIFIED BY 'password'; GRANT PRIVILEGE ON *.* TO 'user'@'localhost'; GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost' WITH GRANT OPTION; GRANT CREATE, ALTER, DROP, INSERT, UPDATE, DELETE, SELECT, REFERENCES, RELOAD on *.* TO 'user'@'localhost' WITH GRANT OPTION;
server { listen 80; root /var/www/html/wordpress; index index.php index.html index.htm; server_name localhost; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
Ref: https://betterprogramming.pub/how-to-create-a-superuser-in-mysql-1a300ef6ffba