共有 5 篇文章
📅 最近更新
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-09-29
- 2024-09-18
叙述使用以下代码修改图片大小或创建缩略图。
参数说明:
$filename
:文件名。
$tmpname
:文件路径,如上传中的临时目录。
$xmax
:修改后最大宽度。
$ymax
:修改后最大高度。
2019-07-09
- 2025-04-01
LNMP一键安装包是一个用Linux Shell编写的可以为CentOS/RHEL/Fedora/Aliyun/Amazon、Debian/Ubuntu/Raspbian/Deepin/Mint Linux VPS或独立主机安装LNMP(Nginx/MySQL/PHP)、LNMPA(Nginx/MySQL/PHP/Apache)、LAMP(Apache/MySQL/PHP)生产环境的Shell程序。
2019-02-19
- 2024-09-18
什么叫正则表达式
正则表达式是对字符串进行操作的一种逻辑公式,就是用一些特定的字符组合成一个规则字符串,称之为正则匹配模式。
1$pre = '/apple/';
2$str = "apple banna orange";
3if (preg_match($pre, $str)) {
4 echo 'matched';
5}
其中字符串/apple/
就是一个正则表达式,他用来匹配源字符串中是否存在apple字符串。
PHP中使用PCRE库函数进行正则匹配,比如上例中的preg_match
用于执行一个正则匹配,常用来判断一类字符模式是否存在。