apache 或 nginx + php >= 7.1 apache 或 nginx + php >= 8.0
1、pdo 2、mbstring 3、gd 4、curl 5、其他扩展见对应工具类的使用说明
phpGrace 需要 web 服务器的伪静态支持,请开启对应 web 服务器的伪静态模块。
1 开启 apache 伪静态模块,相关教程 https://www.jb51.net/article/48389.htm ;
2 将 .htaccess 文件添加到对应应用文件夹下 ( 下载框架时已包含此文件,使用命令新建站点或分组时会自生成此文件 )。
伪静态代码 :
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ ./index.php?pathInfo=$1 [QSA,PT,L] </IfModule>
nginx 可以用个2种方式实现伪静态,下面将详细说明 :
server { listen 80; server_name ******; if ( !-e $request_filename ) { rewrite ^/(.*)$ /index.php?pathInfo=$1 last; } location ~ \.php(.*)$ { ......... } }
开启 nginx.htacces 支持, 利用框架自带的 nginx.htacces 实现伪静态即可。
server { listen 80; server_name ******; root "******"; location / { index index.php index.html; ....... include 绝对路径/nginx.htaccess; autoindex off; } location ~ \.php(.*)$ { ......... } }
注意 : nginx 修改配置文件后需要 重启 生效~