aizu's Knowledge Base
    • Go to: aizu.my Homepage
    • Recent
    • Tags
    • Register
    • Login

    nginx conf for PHP-FPM

    Linux
    1
    1
    71
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      aizu
      last edited by aizu

      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

      1 Reply Last reply Reply Quote 0
      • First post
        Last post