不灭的火

革命尚未成功,同志仍须努力 _ 加密SHA/AES/RSA下载JDK17

作者:AlbertWen  添加时间:2025-09-27 17:25:34  修改时间:2025-10-01 12:58:49  分类:05.Windows服务器  编辑

Windows电脑安装了PHP开发套件EServer,打算在本地搭建运行一套开源的资产管理系统GLPI,但是EServer默认的Nginx配置运行不了GLPI,报404错误,需要参考GLPI官网安装教程,重新配置Nginx虚拟站点。

第一步:在EServer中安装PHP8.3 + MySQL8.0

第二步:安装OpenSSL,参考文章:Windows 11 安装OpenSSL:资产管理系统GLPI安装的时候依赖OpenSSL生成密钥

第三步:新建EServer的虚拟站点,域名为 glpi.fuyo.com,自动添加到本地hosts。把GLPI的PHP代码拷贝到路径 D:/www/php/EServer-data/www/glpi.fuyo.com/

第四步:修改上一步新建的站点glpi.fuyo.com的Nginx配置(参考官方的Nginx配置教程:点击打开)修改后的内容如下:

server
{
    listen 80;
    server_name glpi.fuyo.com;
    index index.html index.htm index.php;

    #=====================================================
    #注意:需指向public目录
    #=====================================================
    root  D:/www/php/EServer-data/www/glpi.fuyo.com/public;

    autoindex off;

    #PHP_START
    #【注意】实际路径为:D:\www\php\EServer-data\childApp\server\nginx\conf\php\php-8.3.conf
    #include php/php-8.3.conf;
    #PHP_END

    #=====================================================
    location / {
        try_files $uri /index.php$is_args$args;
    }

    location ~ ^/index\.php$ {
        # the following line needs to be adapted, as it changes depending on OS distributions and PHP versions
        fastcgi_pass 127.0.0.1:9014;

        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;

        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
    #=====================================================


    #301_START
    #301_END

    #HTTP_TO_HTTPS_START
    #HTTP_TO_HTTPS_END

    #SSL_START
    #SSL_END

    #REWRITE_START
    include vhosts/rewrite/glpi.fuyo.com_80.conf;
    #REWRITE_END

    #EXTRA_INFO_START
    #{"syncHosts":true}
    #EXTRA_INFO_END

    #禁止访问的文件或目录
    location ~ ^/(\.user.ini|\.htaccess|\.git|\.env|\.svn|\.project|LICENSE|README.md)
    {
        return 404;
    }

    location ~ .+\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires      1d;
        error_log nul;
        access_log off;
    }

    location ~ .+\.(js|css)$
    {
        expires      1h;
        error_log nul;
        access_log off;
    }

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    access_log  logs/glpi.fuyo.com_80.access.log;
    error_log  logs/glpi.fuyo.com_80.error.log;
}

第五步:开启所需的PHP扩展

打开 php.ini 配置文件,路径为:D:\www\php\EServer-data\childApp\php\php-8.3\php.ini

去掉 ;extension=intl 前面的;,回到 EServer界面,重启 PHP-FPM-8.3

第六步:在线安装配置GLPI

在浏览器中打开网址:http://glpi.fuyo.com

 

 

最新版本的 GLPI v11需要的运行环境要求:

  1. PHP >=8.2
  2. MySQL >=8.0
  3. OpenSSL组件

 必须安装的PHP扩展:

  1. dom, fileinfo, filter, libxml, simplexml, xmlreader, xmlwriter (these are enabled in PHP by default)
  2. bcmath (QRCode generation)
  3. curl (access to remote resources, like inventory agents, marketplace API, RSS feeds, ...)
  4. gd (pictures handling)
  5. intl (internationalization)
  6. mbstring (multibyte chars support and charset conversion)
  7. mysqli (communication with database server)
  8. openssl (email sending using SSL/TLS, encrypted communication with inventory agents and OAuth 2.0 authentication)
  9. zlib (handling of compressed communication with inventory agents, installation of gzip packages from marketplace, PDF generation)

建议安装的PHP扩展:

  1. bz2, phar and zip (support of most common packages formats in marketplace)
  2. exif (security enhancement on images validation)
  3. ldap (usage of authentication through remote LDAP server)
  4. Zend OPcache (improve performances)