Feature #7472
Support HHVM as an engine to replace PHP
Description
HHVM (http://hhvm.com/) is an alternate engine to run PHP applications, notably used by Facebook, and which offers much better performances than official PHP engine in most cases.
Try to have Chamilo run on it without failure, and maybe even support it officially.
This could help making Chamilo more performant, and certainly more universal, and maybe unveil otherwise unnoticed bugs.
This might be related to supporting PHP 7.0 planned for end of 2015.
History
Updated by Yannick Warnier about 6 years ago
This is a very very complex process at the moment, because HHVM is relatively more strict than PHP.
Supporting PHP7 should, indeed, help us in the process. At the moment, given the more than 700,000 lines of code in PHP, it is unlikely we will be able to support it anytime soon.
Maybe the Chamilo LMS 2.0 rewrite will help in this process as well.
Updated by Jérôme Warnier almost 6 years ago
- Status changed from New to Assigned
- Assignee set to Jérôme Warnier
- Target version set to 2.0
I will give it a try myself, and report my initial findings here.
Updated by Erick Ocrospoma over 5 years ago
Hi, I will be very glad to help with this. I will be testing it too, any additional info/update please let me know, or share it here.
Updated by Jérôme Warnier over 5 years ago
- Description updated (diff)
Installation instructions for HHVM:
https://github.com/facebook/hhvm/wiki/Getting-Started
Specifics to Jessie:
https://github.com/facebook/hhvm/wiki/Prebuilt-Packages-on-Debian-8
Sadly, HHVM only has a compiler for AMD64, so there are only packages for this architecture, which significantly restricts our options for testing it (exit old PCs, and Raspberry Pi).
Updated by Jérôme Warnier over 5 years ago
Repository for PHP7 packages for Debian Jessie:
http://php7.zend.com/repo.php
Updated by Yannick Warnier over 5 years ago
It's actually easer to test it with docker (https://hub.docker.com/_/php/):
docker run --name myphp7 -it php:7-apache bash apt-get update apt-get install wget mysql-server mysql-client vim service mysql start mysql -u root -p [pass] > grant all privileges on chamilo.* to chamilo@localhost identified by 'chamilo'; > create database chamilo; > flush privileges; > exit cd /var/www wget https://github.com/chamilo/chamilo-lms/archive/v1.10.0-alpha.tar.gz tar zxf v1.10.0-alpha.tar.gz mv chamilo-lms-1.10.0-alpha/ chamilo cd /etc/apache2/sites-available/ cp 000-default.conf chamilo.conf # contents of chamilo.conf: <VirtualHost *:80> ServerName docker.chamilo.net ServerAdmin webmaster@localhost DocumentRoot /var/www/chamilo ErrorLog ${APACHE_LOG_DIR}/chamilo-error.log CustomLog ${APACHE_LOG_DIR}/chamilo-access.log combined <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/chamilo> Options Indexes FollowSymLinks MultiViews AllowOverride All Require all granted </Directory> php_admin_value date.timezone "Europe/Paris" </VirtualHost> # end of contents of chamilo.conf a2ensite chamilo.conf a2enmod rewrite service apache2 restart # In order for Chamilo to work, you need more PHP extensions # than what comes with the php7 docker container, and you # cannot install them with apt-get because these would be from PHP5 # (the Ubuntu packages) so you need to do this: apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng12-dev libicu-dev docker-php-ext-install intl pdo_mysql gd # Also, there is a small issue in this version of Chamilo that requires the mysql extension when pdo_mysql is perfectly fine: cd /var/www/chamilo vim main/install/install.lib.php + 715 (change 'mysql' for 'pdo_mysql') # and change permissions... chown -R www-data:www-data app main/default_course_document/images/ main/lang/ web # Finally, add docker.chamilo.net to the container's /etc/hosts (end of first line) # because the server will check if it can access the course at that direction vim /etc/hosts # In another terminal on the host machine: docker inspect myphp7 | grep IPAddress # add the IP as docker.chamilo.net in the host's /etc/hosts # Now load docker.chamilo.net in your browser http://docker.chamilo.net # NOTE: YOU HAVE TO USE 127.0.0.1 as host on the database config page! (sockets will not work with the default MySQL installation)
Updated by Yannick Warnier over 5 years ago
So apart from a small warning at the end of the installer:
Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /var/www/chamilo/vendor/symfony/security/Core/Encoder/BCryptPasswordEncoder.php on line 81 Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /var/www/chamilo/vendor/symfony/security/Core/Encoder/BCryptPasswordEncoder.php on line 81
and the pdo_mysql issue, everything seems to work quite smoothly...
Updated by Yannick Warnier over 5 years ago
Support for HHVM seems a little bit more complex, so I will not delve into it for now: https://hub.docker.com/r/diegomarangoni/hhvm/
(also there's no official hhvm image, so I picked the one with the most pulls)