moodle not showing CSS and theme with linux server

前端 未结 10 750
醉梦人生
醉梦人生 2021-01-06 01:10

I\'m experiencing a problem regarding Moodle.

I\'ve made an install into a Linux server, but CSS and themes are not displaying so i have only plain text.

Ho

10条回答
  •  死守一世寂寞
    2021-01-06 01:32

    I upgraded server OS from Debian 8 to Debian 9 Stretch, and CSS stopped to work in Moodle after this.

    I used ProxyPassMatch in Apache config to use PHP 7.0 for Moodle v3.x and PHP 5.6 for the rest of the sites:

    ProxyPassMatch "^/(.*\.php(/.*)?)$" "unix:/var/run/php/php7.0-fpm.sock|fcgi://localhost/var/www/"
    

    One possible reason why this happens. As it is decribed on: https://httpd.apache.org/docs/2.4/mod/mod_proxy_fcgi.html#env

    The reason, why the ProxyPassMatch does not set the PATH_INFO is the following:

    Environment Variables

    In addition to the configuration directives that control the behaviour of mod_proxy, there are a number of environment variables that control the FCGI protocol provider:

    • proxy-fcgi-pathinfo: When configured via ProxyPass or ProxyPassMatch, mod_proxy_fcgi will not set the PATH_INFO environment variable. This allows the backend FCGI server to correctly determine SCRIPT_NAME and Script-URI and be compliant with RFC 3875 section 3.3. If instead you need mod_proxy_fcgi to generate a "best guess" for PATH_INFO, set this env-var. This is a workaround for a bug in some FCGI implementations. This variable can be set to multiple values to tweak at how the best guess is chosen (In 2.4.11 and later only):

      • first-dot: PATH_INFO is split from the slash following the first "." in the URL.

      • last-dot: PATH_INFO is split from the slash following the last "." in the URL.

      • full: PATH_INFO is calculated by an attempt to map the URL to the local filesystem.

      • unescape: PATH_INFO is the path component of the URL, unescaped / decoded.

      • any other value: PATH_INFO is the same as the path component of the URL. Originally, this was the only proxy-fcgi-pathinfo option.

    The solution is described here: https://serverfault.com/questions/888114/missing-path-info-on-apache-2-4-php5-6-fpm-proxy-fcgi/935406#935406

    SetHandler should be set in Apache config like this to solve the PATH_INFO variable problem:

    
            SetHandler  "proxy:unix:/run/php/user.sock|fcgi://localhost"
    
    
    
    

提交回复
热议问题