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.
How can this be possible and how to solve it?
Thanks.
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.
How can this be possible and how to solve it?
Thanks.
This solution should work. I ran into the same problem after I migrated from local to production and I had to disable Use slash arguments in
Sites Administration > Server > HTTP.
It is the first item you see on the page. Just deselect it if it is checked and save to see if that helps.
I've had this same issue after installing a clean moodle 3.1x
Got stuck installing because i couldnt fill the password input fields due to the lack of JS load.
I couldn´t navigate to "Sites Administration > Server > HTTP" either so i edited config.php to manually disable slasharguments
Just add $CFG->slasharguments = false;
before require_once(__DIR__ . '/lib/setup.php');
Today i installed the latest moodle 3.2
on Linux Ubuntu
server with Apache2
and PHP5.6
. After successful installation, on the final screen no css or js was loading. pretty much similar to your issue. Getting ERR_CONTENT_DECODING_FAILED
when url is hit
/theme/yui_combo.php?rollup/3.17.2/yui-moodlesimple-min.css
I did some googling and found that its related to zlib compression and after enabling it in my php.ini file the problem is solved.
Locate your php.ini files, Go to php.ini file
sudo vi /etc/php/5.6/apache2/php.ini
Add or set below 2 lines
zlib.output_compression = on
zlib.output_compression_level = 6
Restart apache
sudo service apache2 restart
It will start working fine.
Related problem: https://moodle.org/mod/forum/discuss.php?d=324581#p1421502
you can disable slash argument in Sites Administration > Server > HTTP but no recommended. Activate your server slash argument. Docs here: https://docs.moodle.org/36/en/Using_slash_arguments
It seems that you are viewing the moodle with standard theme.
By default in moodle the standard theme would be applied. You can choose any other theme which is available under the theme section.
To change the theme, you will to have access the theme section page as admin.
Administration > Site administration > Appearance > Themes > Theme Selector
After select any other theme, you will have to do purge all cache.
For more information about changing the theme: Change moodle theme
If you are using nginx make sure your config file in /etc/nginx/sites-enabled/[your site] is according to the directions from moodle. Copy this config https://docs.moodle.org/32/en/Nginx
Have you checked your web server to see if there are any error messages?
Next, have you tried looking in your web browser developer tools, to see if there are any errors there (especially 404 errors)?
Finally, make sure debugging is on for your Moodle site (right up to developer level) and see if that sheds some light on the problem.
You might also want to check that all of your Moodle data folder is writable, as otherwise Moodle may have trouble generating the cached theme files.
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:
<FilesMatch "\.php$">
SetHandler "proxy:unix:/run/php/user.sock|fcgi://localhost"
</FilesMatch>
<Proxy "fcgi://localhost/" enablereuse=on max=10>
</Proxy>
The most basic reason it might not show any CSS or styling could be improper permissions set in the Moodle data folder. If Apache cannot write to that directory then it cannot process the SCSS and generate cache files needed.
It is a late response but I think it may help someone like me. I too ran into the same situation when I migrated moodle from Google Cloud to Godaddy which resulted in just plain text pages without any css. I tried doing a fresh installation of moodle just to check if there are any missing elements. The installation refused to continue and gave an error message that "PHP iconv extension is missing". Later I went to the terminal and ran the following command (to install the missing iconv extenstion and restart apache):
yum install ea-php73-php-iconv -y
sudo systemctl restart httpd
That's it..everything started working as expected!
That helped me, but I dont know why.
nginx conf file of site:
... location ~ [^/]\.php(/|$) { ... try_files $uri =404; #comment this line if it exists ... } ...
Even I had the same issue CSS are not loading properly and some js issues,
then I made some nginx site configuration changes after that site is loading properly
sharing my site-configuration file
server {
listen 80;
server_name moodle.local;
root /var/www/html/moodle/moodle;
index index.php index.html index.htm index.nginx-debian.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ ^(.+\.php)(.*)$ {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_index index.php;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
include /etc/nginx/mime.types;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
Three common issues that I've seen cause a Moodle site to not display CSS:
https://
instead of http://
, or vice versa?