php-wordpressHow to configure Nginx for WordPress?
- Install Nginx and PHP on your server.
-
Create a new Nginx configuration file for your WordPress site.
server { listen 80; server_name example.com; root /var/www/example.com; index index.php; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.2-fpm.sock; } }
- Enable the new configuration file and restart Nginx.
sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/ sudo systemctl restart nginx
- Install WordPress on your server.
- Configure WordPress to use the Nginx configuration.
Helpful links
More of Php Wordpress
- How to get the current URL in WordPress using PHP?
- How to disable PHP warnings in WordPress?
- How to increase the upload limit in WordPress using PHP?
- How to check the PHP version in WordPress?
- How to run an SQL query in WordPress using PHP?
- How to create a snippet in WordPress using PHP?
- How to create a menu in WordPress using PHP?
- How to use get_header in WordPress using PHP?
- How to send an email using PHP in WordPress?
See more codes...