Tag Archives: php

Facebook’s HHVM completely switches to Hack instead of PHP

The next long-term support release of HHVM which will be released in early 2018 is going to be the last version that commits to PHP 5.

Facebook’s Hip-Hop Virtual Machine (HHVM) is a speedy engine for PHP, will not target the most recent major release of PHP (PHP7) and instead will focus on Hack language which is a PHP spinoff.

As trying to support both PHP 7 and Hack would lead the HHVM team to undesirable compromises on both fronts they decided to separate themselves from PHP so they can evolve Hack without having to face all of the oldest and darkest concerns of the PHP’s design.

PHP 7 is representing a substantive departure from PHP 5, it has changed many behaviors which some of them is not backward-compatible, Consequently, HHVM will not aim to target PHP 7 the HHVM development team believes that they have a clear path toward making Hack a fantastic language for web development, untethered from its PHP origins.
Facebook has used HHVM for many years to almost exclusively to run Hack. They said: The Hack language had addressed many of PHP 5’s shortcomings which some of them are fixed by PHP 7 as well and by cutting loose from PHP we are hoping to provide a higher performance experience with HHVM and Hack which can be achieved by creating many features, libraries, and performance opportunities.

Some of the planned improvements of Hack are below:

  • Completing Hack arrays, with array-like data structures that are easier to type-check
  • Eliminating destructors and references
  • Using garbage collection to produce measurable performance improvement.
Conclusion

Hack was born in the PHP ecosystem so Facebook has plans to make HHVM compatible with major PHP tools such as Composer and PHPUnit, but the main goal for Hack is to have its own ecosystem and can act as a core of frameworks.

How to Install Apache 2.2, PHP 5.6, MySQL 5.7 on CentOS 6

Today I am going to teach you the easiest way of installing a Webserver with Apache, PHP, and MySQL.

We are going to use Epel and Remi repositories on CentOS and configure our server. First of all, we should find the latest version of Epel and Remi packages from their sites :

http://dl.fedoraproject.org/pub/epel/6/x86_64/
http://rpms.famillecollet.com/enterprise/

After it, we will download the packages on our system and install them on the server.

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6.rpm epel-release-6-8.noarch.rpm

After these packages are installed completely, we should activate these repositories on Yum configuration file.

nano /etc/yum.repos.d/remi.repo

Make sure that “[remi]” and “[remi-php56]” are enabled. It should look like as following.

[remi]
name=Remi’s RPM repository for Enterprise Linux 6 – $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/remi/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/remi/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

[remi-php56]
name=Remi’s PHP 5.6 RPM repository for Enterprise Linux 6 – $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/php56/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/php56/mirror
# NOTICE: common dependencies are in “remi-safe”
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

We have to save the file and then edit the Epel repository to make sure it is enabled too.

nano /etc/yum.repos.d/epel.repo

It should be enabled as following :

[epel]
name=Extra Packages for Enterprise Linux 6 – $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

Now we can start to install PHP, apache on our system.

yum clean all
yum update
yum install php php-mysql

After all these steps are done, we will install MySQL on our system.

wget http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm
yum localinstall mysql57-community-release-el6-7.noarch.rpm
yum repolist enabled | grep “mysql.*-community.*”
yum install mysql-community-server

It is now fully installed, we will start all services and will confirm the installed versions.

service mysqld restart
mysql –version
service httpd restart
php -v
httpd -v

If you have any question, please add a comment and I will get you back.