Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Yannick Warnier c9ec2eaa97 Internal: Fix incompatible return type in ChamiloCoreExtension 10 months ago
.github Merge pull request #5035 from chamilo/dependabot/github_actions/actions/checkout-4 11 months ago
.yarn/releases Vendor: Bump yarn version to 4.1.0 10 months ago
assets Merge pull request #5142 from christianbeeznest/ofaj-21328 10 months ago
bin Update files to Symfony 5.3 + add phpunit/phpunit 4 years ago
config Internal: Use SonataExporterBundle to replace deprecated SonataExporterSymfonyBundle 10 months ago
public Extra Fields: Language: fix to show extrafield title translation in user language - refs BT#21217 10 months ago
src Internal: Fix incompatible return type in ChamiloCoreExtension 10 months ago
tests Ci: PHPUnit: Temporarily disable unit tests that check for resource removal where those removals are not yet implemented. Will be reactivated soon. 10 months ago
translations Language: Add missing language term 10 months ago
var User: Allow anonymous users to public courses - refs BT#21198 1 year ago
.codeclimate.yml Internal: Remove mimetex, OpenGraph.php 3 years ago
.editorconfig Minor: delete duplicated line in .editorconfig 2 years ago
.env.dist Internal: Rename .env to .env.dist. Developers should rename their .env.local to .env 1 year ago
.env.test Minor: Set default values for db test 10 months ago
.eslintrc.json Vendor: App prettier 2 years ago
.flintci.yml
.gitattributes
.gitignore Internal: Start tracking lock files (set to PHP8.1 for now) 11 months ago
.php_cs
.php_cs.dist Internal: Remove mimetex, OpenGraph.php 3 years ago
.postcssrc.js JS/CSS updates 4 years ago
.prettierignore Vendor: App prettier 2 years ago
.prettierrc.json Add more format options to prettier 1 year ago
.scrutinizer.yml CI: Scrutinizer use php 8.1.2 11 months ago
.yamllint_config Update config 3 years ago
.yarnrc.yml Vendor: Bump yarn version to 4.1.0 10 months ago
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md Update README.md to use NVM 11 months ago
SECURITY.md Documentation: Update SECURITY.md 11 months ago
codecov.yml Disable folders in codecov.yml 3 years ago
composer.json Internal: Start tracking lock files (set to PHP8.1 for now) 11 months ago
composer.lock Internal: Start tracking lock files (set to PHP8.1 for now) 11 months ago
ecs.php CI: Update ECS configuration 11 months ago
index.php
license.txt
package.json Vendor: Bump yarn version to 4.1.0 10 months ago
phpstan.neon Internal: Remove mimetex, OpenGraph.php 3 years ago
phpunit.xml.dist Tests: Update phpunit config, ignore src/DataFixtures 3 years ago
psalm.xml Back to psalm level 7 11 months ago
rector.php Remove unused menus 4 years ago
ruleset.xml
symfony.lock Internal: Start tracking lock files (set to PHP8.1 for now) 11 months ago
tailwind.config.js Display: Fix missing class to enable hover in secondary button 10 months ago
tsconfig.json JS/CSS updates 4 years ago
webpack.config.js Minor: Format code 11 months ago
yarn.lock Vendor: Update Js libs 10 months ago

README.md

Chamilo 2

Behat tests 🐞 PHPUnit 🐛 PHP static analysis ✨ PHP format code 🔎 codecov Scrutinizer Code Quality CII Best Practices Codacy Badge type-coverage psalm level

Chamilo is an e-learning platform, also called "LMS", published under the GNU/GPLv3+ license. It has been used by more than 30M people worldwide since its inception in 2010. This is a development version. For the current stable branch, please select the 1.11.x branch in the Code tab.

Quick install

Chamilo 2.0 is still in development. This installation procedure below is for reference only. For a stable Chamilo, please install Chamilo 1.11.x. See the 1.11.x branch's README.md for details.

We assume you already have:

Software stack install (Ubuntu)

You will need PHP8+ and NodeJS v18+ to run Chamilo 2. On a fresh Ubuntu 22.04, you can prepare your server by issuing an apt command like the following with sudo (or as root, but not recommended for security reasons):

sudo apt update
sudo apt -y upgrade
sudo apt -y install ca-certificates curl gnupg software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install apache2 libapache2-mod-php8.1 mariadb-client mariadb-server php-pear php8.1-{dev,gd,curl,intl,mysql,mbstring,zip,xml,cli,apcu,bcmath,soap} git unzip

If you already have nodejs installed, check the version with node -v Otherwise, install node 18 or above:

cd ~
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
NODE_MAJOR=20
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
apt update && apt -y install nodejs
  • Other option to install nodejs is by using NVM (Node Version Manager). You can install it following the instructions here. Then, you can install the node version required. Preferably, the LTS version.
sudo nvm install --lts
sudo nvm use --lts

With NodeJS installed, you must enable corepack and then continue with the requirements

sudo corepack enable
cd ~
# follow the instructions at https://getcomposer.org/download/
sudo mv composer.phar /usr/local/bin/composer
# optionally, you might want this:
sudo apt install libapache2-mod-xsendfile
sudo a2enmod rewrite ssl headers expires
sudo systemctl restart apache2

When your system is all set, you can use the following:

cd /var/www
git clone https://github.com/chamilo/chamilo-lms.git chamilo2
cd chamilo2
composer install
# not recommended to do this as the root user!
# when asked whether you want to execute the recipes or install plugins for some of the components,
# you can safely type 'n' (for 'no').

yarn set version stable
# delete yarn.lock as it might contain restrictive packages from a different context
yarn up
yarn install
yarn dev
# you can safely ignore any "warning" mentioned by yarn dev
sudo touch .env
sudo chown -R www-data: var/ .env config/

In your web server configuration, ensure you allow for the interpretation of .htaccess (AllowOverride all and Require all granted), and point the DocumentRoot to the public/ subdirectory.

Web installer

Once the above is ready, enter the main/install/index.php and follow the UI instructions (database, admin user settings, etc).

After the web install process, change the permissions back to a reasonably safe state:

chown -R root .env config/

Quick update

If you have already installed it and just want to update it from Git, do:

git pull
composer update

# Database update
php bin/console doctrine:schema:update --force --complete

# Clean Symfony cache
php bin/console cache:clear

# js/css update
yarn install
yarn dev

This will update the JS (yarn) and PHP (composer) dependencies in the public/build folder.

Some times there are conflicts with existing files so to avoid those here are some hints :

  • for composer errors you can remove the vendor folder and composer.lock file
  • for yarn erros you can remove yarn.lock .yarn/cache/* node_modules/*
  • when opening Chamilo, it does not load, then you can delete var/cache/*

Refresh configuration settings

In case you believe some settings in Chamilo might not have been processed correctly based on an incomplete migration or a migration that was added after you installed your development version of Chamilo, the URL /admin/settings_sync is built to try and fix that automatically by updating PHP classes based on the database state. This issue rarely happens, though.

Quick re-install

If you have it installed in a dev environment and feel like you should clean it up completely (might be necessary after changes to the database), you can do so by:

  • Removing the .env file
  • Load the {url}/main/install/index.php script again

The database should be automatically destroyed, table by table. In some extreme cases (a previous version created a table that is not necessary anymore and creates issues), you might want to clean it completely by just dropping it, but this shouldn't be necessary most of the time.

If, for some reason, you have issues with either composer or yarn, a good first step is to delete completely the vendor/ folder (for composer) or the node_modules/ folder (for yarn).

Development setup (Dev environment, stable environment not yet available)

If you are a developer and want to contribute to Chamilo in the current development branch (not stable yet), then please follow the instructions below. Please bear in mind that the development version is NOT COMPLETE at this time, and many features are just not working yet. This is because we are working on root components that require massive changes to the structure of the code, files and database. As such, to get a working version, you might need to completely uninstall and re-install from time to time. You've been warned.

First, apply the procedure described here: Managing CSS and JavaScript in Chamilo (in particular, make sure you follow the given links to install all the necessary components on your computer).

Then make sure your database supports large prefixes (see this Stack Overflow thread if you use MySQL < 5.7 or MariaDB < 10.2.2).

Load the (your-domain)/main/install/index.php URL to start the installer (which is very similar to the installer in previous versions). If the installer is pure-HTML and doesn't appear with a clean layout, that's because you didn't follow these instructions carefully. Go back to the beginning of this section and try again.

If you want hot reloading for assets use the command yarn run encore dev-server. This will refresh automatically your assets when you modify them under assets/vue. Access your chamilo instance as usual. In the background, this will serve assets from a custom server on http://localhost:8080. Do not access this url directly since Encore is in charge of changing url assets as needed.

Supporting PHP 7.4 and 8.1 in parallel

You might want to support PHP 8.1 (for Chamilo 2) and PHP 7.4 (for all other things) on the same server simultaneously. On Ubuntu, you could do it this way:

sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.1 libapache2-mod-php7.4 php8.1-{modules} php7.4-{modules}
sudo apt remove libapache2-mod-php8.1 php7.4-fpm
sudo a2enmod proxy_fcgi
sudo vim /etc/apache2/sites-available/[your-chamilo2-vhost].conf

In the vhost configuration, make sure you set PHP 8.1 FPM to answer this single vhost by adding, somewhere between your <VirtualHost> tags, the following:

  <IfModule !mod_php8.c>
    <IfModule proxy_fcgi_module>
        <IfModule setenvif_module>
        SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
        </IfModule>
        <FilesMatch ".+\.ph(ar|p|tml)$">
            SetHandler "proxy:unix:/run/php/php8.1-fpm.sock|fcgi://localhost"
        </FilesMatch>
        <FilesMatch ".+\.phps$">
            Require all denied
        </FilesMatch>
        <FilesMatch "^\.ph(ar|p|ps|tml)$">
            Require all denied
        </FilesMatch>
    </IfModule>
  </IfModule>

Then exit and restart Apache:

sudo systemctl restart apache2

Finally, remember that PHP settings will have to be changed in /etc/php/8.1/fpm/php.ini and you will have to reload php8.1-fpm to take those config changes into account.

sudo systemctl reload php8.1-fpm

When using 2 versions, you will also have issues when calling composer update, as this one needs to be called by the relevant PHP version. This can be done like so:

/usr/bin/php8.1 /usr/local/bin/composer update
or, for Chamilo 1.11
/usr/bin/php7.4 /usr/local/bin/composer update

If your default php-cli uses PHP7.4 (see ln -s /etc/alternatives/php), you might have issues running with a so-called platform_check.php script when running composer update anyway. This is because this script doesn't user the proper launch context, and you might need to change your default settings on Ubuntu (i.e. change the link /etc/alternatives/php to point to the other php version) before launching composer update. You can always revert that operation later on if you need to go back to work on Chamilo 1.11 and Composer complains again.

Changes from 1.x

  • in general, the main/ folder has been moved to public/main/
  • app/Resources/public/assets moved to public/assets
  • main/inc/lib/javascript moved to public/js
  • main/img/ moved to public/img
  • main/template/default moved to src/CoreBundle/Resources/views
  • src/Chamilo/XXXBundle moved to src/CoreBundle or src/CourseBundle
  • bin/doctrine.php removed use bin/console doctrine:xyz options
  • Plugin images, css and js libs are loaded inside the public/plugins folder (composer update copies the content inside plugin_name/public inside web/plugins/plugin_name
  • Plugins templates use asset() function instead of using "_p.web_plugin"
  • Remove main/inc/local.inc.php
  • Translations managed through Gettext

Libraries

  • Integration with Symfony 5
  • PHPMailer replaced with Symfony Mailer
  • bower replaced by yarn

JWT Authentication

  • Run
    php bin/console lexik:jwt:generate-keypair
    
  • In Apache setup Bearer with:
    SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
    
  • Get the token:
    curl -k -X POST https://example.com/api/authentication_token \
        -H "Content-Type: application/json" \
        -d '{"username":"admin","password":"admin"}'
    
    The response should return something like:
    {"token":"MyTokenABC"}
    
  • Go to https://example.com/api
  • Click in "Authorize" button and write the value Bearer MyTokenABC

Then you can make queries using the JWT token.

Todo

See https://github.com/chamilo/chamilo-lms/projects/3

Contributing

If you want to submit new features or patches to Chamilo 2, please follow the Github contribution guide https://guides.github.com/activities/contributing-to-open-source/ and our CONTRIBUTING.md file. In short, we ask you to send us Pull Requests based on a branch that you create with this purpose into your repository forked from the original Chamilo repository.

Documentation

For more information on Chamilo, visit https://campus.chamilo.org/documentation/index.html