search

Home  >  Q&A  >  body text

Moodle found invalid permissions when creating a directory

I encountered an error when trying to run a project developed in Moodle. "Invalid permissions detected" is displayed when trying to create a directory. "Turn on debugging for more details." error. I've run this command "chmod 0777 /var/www/html/e-learning" to enable write permissions but still doesn't work. Can anyone advise? Thanks.

P粉099985373P粉099985373340 days ago744

reply all(1)I'll reply

  • P粉476883986

    P粉4768839862023-12-25 09:19:07

    This may be the data directory rather than the web directory

    https://docs.moodle.org/401/en /Installing_Moodle#Create_the_.28moodledata.29_data_directory

    Look for this value in config.php

    $CFG->dataroot = '/var/yourmoodledatadirectory';

    Then change permissions

    sudo chmod -R 0777 /var/yourmoodledatadirectory

    Also add it to config.php

    $CFG->directorypermissions = 02777;

    You may also need to change the ownership of the data directory

    sudo chown -R www-data /var/yourmoodledatadirectory

    Also, using 777 for web directories is deprecated, please use 755

    instead
    sudo chmod -R 0755 /var/www/html/moodle

    reply
    0
  • Cancelreply