共有 277 篇文章
📅 最近更新
2019-11-06
- 2024-09-18
Ubuntu 18.04
安装PHP7并配置Nginx
安装
1sudo apt-get install software-properties-common python-software-properties
2sudo add-apt-repository ppa:ondrej/php
3sudo apt-get update
4sudo apt-get -y install php7.3
5
6# 安装常用扩展
7sudo -y apt-get install php7.3-fpm php7.3-mysql php7.3-curl php7.3-json php7.3-mbstring php7.3-xml php7.3-intl
8
9# 安装其他扩展(按需安装)
10sudo apt-get install php7.3-gd
11sudo apt-get install php7.3-soap
12sudo apt-get install php7.3-gmp
13sudo apt-get install php7.3-odbc
14sudo apt-get install php7.3-pspell
15sudo apt-get install php7.3-bcmath
16sudo apt-get install php7.3-enchant
17sudo apt-get install php7.3-ldap
18sudo apt-get install php7.3-opcache
19sudo apt-get install php7.3-readline
20sudo apt-get install php7.3-sqlite3
21sudo apt-get install php7.3-xmlrpc
22sudo apt-get install php7.3-bz2
23sudo apt-get install php7.3-interbase
24sudo apt-get install php7.3-pgsql
25sudo apt-get install php7.3-recode
26sudo apt-get install php7.3-sybase
27sudo apt-get install php7.3-xsl
28sudo apt-get install php7.3-cgi
29sudo apt-get install php7.3-dba
30sudo apt-get install php7.3-phpdbg
31sudo apt-get install php7.3-snmp
32sudo apt-get install php7.3-tidy
33sudo apt-get install php7.3-zip
配置Nginx+PHP
1server {
2 listen 80;
3 listen [::]:80;
4
5 root /var/www/akvicor.com/html;
6 index index.php index.html index.htm index.nginx-debian.html;
7
8 server_name akvicor.com www.akvicor.com;
9
10 location / {
11 try_files $uri $uri/ /index.php$is_args$args;
12 }
13
14 location ~ \.php$ {
15 try_files $uri =404;
16
17 include fastcgi.conf;
18 fastcgi_pass 127.0.0.1:9000;
19 }
20}
编译安装PHP7
下载源码
2019-11-06
- 2024-09-18
2019-11-06
- 2024-09-18
Ubuntu 18.04
搭建Nginx服务
安装
Ubuntu可以从源直接安装nginx
1sudo apt-get update
2sudo apt-get install nginx
调整防火墙,以免出现各种问题
1sudo ufw app list
获得应用程序配置文件的列表:
1可用应用程序:
2CUPS
3Nginx Full
4Nginx HTTP
5Nginx HTTPS
6OpenSSH
正如你所看到的,Nginx有三个配置文件可用:Nginx Full
、Nginx HTTP
、Nginx HTTPS
2019-10-28
- 2024-09-15
2019-10-07
- 2024-09-18
- 当使用国外服务器搭建网站的时候, 可能遇到一些网站屏蔽了网站IP, 因此需要检测一下是否被屏蔽
- 当使用国外服务器搭建网站的时候经常会碰到一些 IP 因为被墙导致网站不能访问,所以可以先检测一下 IP 是否被墙。