Home » Default » Debian10.7安装Nginx1.14.2,PHP7.3

apt-get update
apt-get install nginx
apt-get install php
apt-get install php7.3-fpm
systemctl start php7.3-fpm

vi /etc/nginx/conf.d/default.conf

##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Default server configuration
#
server {
    listen 80 default_server;

    root /var/www/html;

    index index.php index.html index.htm index.nginx-debian.html;

    server_name _;

    location / {

        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {

        fastcgi_pass unix:/run/php/php7.3-fpm.sock;

        fastcgi_index  index.php;

        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

        include fastcgi_params;    
    }

}


# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
#    listen 80;
#    listen [::]:80;
#
#    server_name example.com;
#
#    root /var/www/example.com;
#    index index.html;
#
#    location / {
#        try_files $uri $uri/ =404;
#    }
#}

systemctl restart nginx

1.sudo mysql -u root
2.use mysql;
3.select user, plugin from mysql.user;
4.update mysql.user set authentication_string=PASSWORD('newPwd'), plugin='mysql_native_password' where user='root';
5.flush privileges;
6.exit

标签: PHP Nginx Debian

添加新评论

V