I had the same problem a while ago, I fixed it by installing the missing extensions, i.e.
$ sudo apt-get install php5-gd php5-mcrypt
If unnecessary, you can try to find out which files are loading the missing extensions, for example (on my machine)
$ grep -Hr "extension=" /etc/php5
/etc/php5/mods-available/opcache.ini:zend_extension=opcache.so
/etc/php5/mods-available/json.ini:extension=json.so
/etc/php5/mods-available/mcrypt.ini:extension=mcrypt.so
...
and comment out the lines in the files giving an error.
Edit It is also possible that the specified paths are incorrect, perhaps you can fix them.