It sounds like you don’t have the GD extension installed. I don’t use Ubuntu any longer, but I think it may be named php5-gd, so you’d need to install that package and restart your webserver and it should then work.
Ubuntu 16.04 comes with PHP7 as the standard, so there are no PHP5 packages
However if you like you can add a PPA to get those packages anyways:
Remove all the stock php packages
List installed php packages with dpkg -l | grep php| awk '{print $2}' |tr "\n" " "
then remove unneeded packages with sudo aptitude purge your_packages_here or if you want to directly remove them all use :
1 | <span class="pln">sudo aptitude purge </span><span class="str">`dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`</span> |
Add the PPA
1 | <span class="pln">sudo add</span><span class="pun">-</span><span class="pln">apt</span><span class="pun">-</span><span class="pln">repository ppa</span><span class="pun">:</span><span class="pln">ondrej</span><span class="pun">/</span><span class="pln">php</span> |
Install your PHP Version
1 2 | <span class="pln">sudo apt</span><span class="pun">-</span><span class="kwd">get</span><span class="pln"> update sudo apt</span><span class="pun">-</span><span class="kwd">get</span><span class="pln"> install php5</span><span class="pun">.</span><span class="lit">6</span> |
You can install php5.6 modules.
1 2 3 4 5 | <strong>Install php-xml</strong> sudo apt-get install php-xml |
1 2 | <strong>Install php-gd</strong></code><code> apt-get install php5.6-gd |
PHP7 packages for Ubuntu including php7.0-gd
can be installed via PPA for PHP by Ondřej Surý:
1 2 3 | <span class="pln">sudo add</span><span class="pun">-</span><span class="pln">apt</span><span class="pun">-</span><span class="pln">repository ppa</span><span class="pun">:</span><span class="pln">ondrej</span><span class="pun">/</span><span class="pln">php sudo apt</span><span class="pun">-</span><span class="kwd">get</span><span class="pln"> update sudo apt</span><span class="pun">-</span><span class="kwd">get</span><span class="pln"> install php7</span><span class="pun">.</span><span class="lit">0</span><span class="pun">-</span><span class="pln">gd</span> |
EDIT:
As MacroMan stated, under Ubuntu 16.04 you don’t need to add the repository any more. Simply issuing sudo apt-get install php7.0-gd
works.
Install php-curl
1 | <span class="pln">sudo apt</span><span class="pun">-</span><span class="kwd">get</span><span class="pln"> install php</span><span class="pun">-</span><span class="pln">curl</span> |
Install mod_proxy to get ProxyPass to work
In the end I guessed that the module proxy_http in the mods-enabled directory might work, and used the command:
a2enmod proxy_http
Verify your version
1 | <span class="pln">sudo php </span><span class="pun">-</span><span class="pln">v</span> |
Based on http://askubuntu.com/a/756186/532957 (thanks @AhmedJerbi)