PHP – Use of undefined constant MCRYPT_BLOWFISH – assumed ‘MCRYPT_BLOWFISH

While your coding session, you encounter this error :

Use of undefined constant MCRYPT_BLOWFISH - assumed 'MCRYPT_BLOWFISH

You think, easy, a module should be missing on my php
So you install it :

sudo apt-get install php5-mcrypt

And restart apache.

But it still doesn’t work. In phpinfo() it seems the module is not installed.

In fact with the new version of PHP, you still need to activate the module

php5enmod -s apache2 mcrypt

The restart apache and the module should work.

Invalid command ‘Header’, perhaps misspelled or defined by a module not included in the server configuration

You have this error message on your apache logs

/home/www/.htaccess: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration

Check the .htaccess file and there is no Header command…

<FilesMatch "\.(xml|jpg)$">
FileETag None
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</FilesMatch>

In fact, this issue is due to the header apache’s module whose’s missing.
To install it, run

a2enmod headers

And don’t forget to restart apache

service apache2 restart