phpGrace环境支持

samool 发布暂无评论6179 阅读

AI摘要

phpGrace是一个PHP框架,需要Apache/Nginx服务器和PHP 5.3以上版本,不支持IIS。需要安装pdo、mbstring、gd、curl等PHP扩展。框架需要服务器支持伪静态,提供了Apache和Nginx的伪静态设置示例。

phpGrace 对 php 环境要求如下 :

apache/nginx + php 5.3 + ( 使用命名空间 )
apache/nginx + php 7.0 +
是的我们“嫌弃”且不支持 IIS + PHP ! ^_^

php 扩展要求

1、pdo
2、mbstring
3、gd
4、curl
5、其他扩展见对应工具类的使用说明

伪静态支持说明
phpGrace 需要 web 服务器的伪静态支持,请开启对应 web 服务器的伪静态模块!

apache 服务器伪静态设置说明 :

将 .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 服务器伪静态设置示例 :

server {
    listen 80;
    server_name  www.phpgrace.com phpgrace.com;
    root   "D:/webs/www.phpgrace.com";
    location /admin {
    index  index.html index.htm index.php;
      if (!-e $request_filename){
          rewrite ^/admin/(.*)$ /admin/index.php?pathInfo=$1;
        }
    }
    location / {
        index  index.html index.htm index.php;
        if (!-e $request_filename){
          rewrite ^(.*)$ ./index.php?pathInfo=$1;
          // 有些nginx 需要去掉 . 根据情况自己调整一下 (:
          // rewrite ^(.*)$ /index.php?pathInfo=$1; 
        }
    }
}

说明 :
/admin 代表 admin 分组(一般我们会将网站后端放置到此分组,命名可以自行设置);

  1. 01phpGrace 目录结构、命名规则2019-11-12
  2. 02[PHP开源框架]phpGrace - 轻快的实力派!2019-11-12
  3. 03PHP2Shell 重大安全漏洞事件深度分析报告2026-10-23
  4. 04代码测试2020-07-30
  5. 05php json转换为数组调用的问题处理2020-05-05
  6. 06php检查URL是否有效2020-04-07
  7. 07PHP date() 函数可实现的功能列表2020-03-21
  8. 08phpgrace 定义json返回数据2020-03-06
  9. 09phpGrace 自带分页参数代码2020-03-05
  10. 10发现phpGrace工具实例化函数bug一枚2020-02-15
COMMENTS / 一纸留言

读者留言 0 条

一纸留言,便是山水间的一次相逢。

还没有留言,欢迎写下第一段交流。

WRITE A COMMENT

写下你的留言