deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main contrib non-free rpi deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main contrib non-free rpi
更改系统源:
1
sudo vim /etc/apt/sources.list.d/raspi.list
将原内容注释并改为
1 2
deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui deb-src http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui
玩客云:
1 2 3 4 5 6 7 8 9 10 11
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal main restricted universe multiverse # deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-security main restricted universe multiverse # deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-security main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse # deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse # deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse
location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files$uri$uri/ =404; index index.html index.htm index.php; }
再找到下面的代码:
1 2 3 4 5 6 7 8
#location ~ \.php$ { # include snippets/fastcgi-php.conf; # # # With php-fpm (or other unix sockets): # fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; # # With php-cgi (or other tcp sockets): # fastcgi_pass 127.0.0.1:9000; #}
改为:(注意要去掉location 和 }前面的“#”号)
1 2 3 4 5 6 7 8 9 10
location~ \.php$ { # include snippets/fastcgi-php.conf; # # # With php-fpm (or other unix sockets): fastcgi_pass unix:/run/php/php7.0-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; # # With php-cgi (or other tcp sockets): # fastcgi_pass 127.0.0.1:9000; }
#设置允许远程连接并修改root密码,123456为root用户的新密码,%代表所有主机 UPDATE mysql.user SET host='%',authentication_string=PASSWORD('123456'), PLUGIN='mysql_native_password' WHERE USER='root';