Update README + add instructions for env w/ PHP8.0

pull/3924/head
Yannick Warnier 4 years ago committed by GitHub
parent 790e988057
commit b0574a0235
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 71
      README.md

@ -7,18 +7,20 @@
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/166/badge)](https://bestpractices.coreinfrastructure.org/projects/166)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/88e934aab2f34bb7a0397a6f62b078b2)](https://www.codacy.com/app/chamilo/chamilo-lms?utm_source=github.com&utm_medium=referral&utm_content=chamilo/chamilo-lms&utm_campaign=badger)
Chamilo is an e-learning platform, also called "LMS" or "LCMS" published under GNU/GPLv3+. It is or has been used by more than 20M people worldwide.
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 stage. This installation procedure is for reference only. For a stable Chamilo, please install Chamilo 1.11.x. See the 1.11.x branch README.md for details.**
**Chamilo 2.0 is still in development. This installation procedure 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:
- composer 2.x - https://getcomposer.org/download/
- yarn 2.x - https://yarnpkg.com/getting-started/install
- Configuring a virtualhost in a domain, not in a sub folder inside a domain.
- A working LAMP server.
- A working LAMP/WAMP server with PHP 8.0+
### Software stack install (Ubuntu)
On a fresh Ubuntu, you can prepare your server by issuing an apt command like the following:
@ -26,6 +28,8 @@ On a fresh Ubuntu, you can prepare your server by issuing an apt command like th
apt update && apt -y upgrade && apt install apache2 libapache2-mod-php mariadb-client mariadb-server php-pear php-dev php-gd php-curl php-intl php-mysql php-mbstring php-zip php-xml php-cli php-apcu php-bcmath php-soap yarn git unzip npm
~~~~
Note: you might need to use more up-to-date versions of nodejs (at least v14) and yarn. These second part of these instructions may help: https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-20-04-fr
Otherwise, you can use the following directly:
~~~~
@ -39,9 +43,13 @@ yarn run encore dev
chmod -R 777 .
~~~~
Note: on Ubuntu Groovy, the `yarn` package has been replaced by `yarnpkg`. In this case, replace `yarn` by `yarnpkg` in all commands above.
Note: on Ubuntu Groovy, the `yarn` package has been replaced by `yarnpkg`. In this case, replace `yarn` by `yarnpkg` in all commands above (make sure you compare both packages with `apt search yarn` to get the latest version).
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
Then enter the **main/install/index.php** and follow the UI instructions (database, admin user settings, etc).
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:
~~~~
@ -49,7 +57,7 @@ chmod -R 755 .
chown -R www-data: public/ var/
~~~~
### Quick update
## Quick update
If you have already installed it and just want to update it from Git, do:
~~~~
@ -65,7 +73,7 @@ yarn run encore dev
~~~~
This will update the JS (yarn) and PHP (composer) dependencies in the public/build folder.
### Quick re-install
## 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:
@ -74,7 +82,9 @@ If you have it installed in a dev environment and feel like you should clean it
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.
## Installation guide (Dev environment, stable environment not yet available)
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,
@ -87,9 +97,52 @@ Then make sure your database supports large prefixes (see [this Stack Overflow t
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.
### Supporting PHP 7.4 and 8.0 in parallel
Because PHP 8.0 is relatively new, you might want to support PHP 8.0 (for Chamilo 2) and PHP 7.4 (for all other things) on the same server simultaneously. On Ubuntu, you could do it this way:
```
add-apt-repository ppa:ondrej/php
apt update
apt install php8.0 libapache2-mod-php7.4
apt remove libapache2-mod-php8.0 php7.4-fpm
a2enmod proxy_fcgi
vim /etc/apache2/sites-available/[your-chamilo2-vhost].conf
```
In the vhost configuration, make sure you set PHP 8.0 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.0-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:
```
systemctl restart apache2
```
Finally, remember that PHP settings will have to be changed in /etc/php/8.0/fpm/php.ini and you will have to reload php8.0-fpm to take those config changes into account.
```
systemctl reload php8.0-fpm
```
## 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

Loading…
Cancel
Save