28 January 2010

Recompiling PHP5 to get imagerotate() and other functions on Debian

Posted by Matthieu under: Miscellaneous

I mostly followed directions from this page with different directory names and I was able to get PHP5 to use the bundled GD library on Debian (lenny).

cd /usr/src/
apt-get source php5
apt-get build-dep php5
cd php5-5.2.6.dfsg.1/
nano debian/rules
(replace '--with-gd=shared,/usr --enable-gd-native-ttf \' with '--with-gd=shared --enable-gd-native-ttf \')
dpkg-buildpackage -rfakeroot
cd ..
dpkg -i *.deb
/etc/init.d/apache2 restart

4 Comments so far...

Cedric P. Says:

3 May 2010 at 10:47.

I just wanted to get news and here is what i get…
“(replace ‘–with-gd=shared,/usr –enable-gd-native-ttf \’ with ‘–with-gd=shared –enable-gd-native-ttf \’)”

I think i have to find the proper section ;-)

Utiliser la fonction PHP imagerotate() sous Debian | Univers Libre Says:

18 December 2010 at 12:47.

[...] contourner le problème, en cherchant un peu sur le net (ici pa exemple), beaucoup de monde recompile PHP avec la version embarqué de GD. Ce n’est à mon avis pas [...]

Matthieu Says:

13 January 2011 at 18:24.

Thanks for the comment I just added the dotdeb repository with the instructions at
http://www.dotdeb.org/instructions/
and no need to re-compile

eugenik Says:

18 May 2011 at 03:29.

enabling imagerotate() on debian lenny without recompiling gd from source:
1. download gd.so extention from here (compiled for php5-gd_5.2.6.dfsg.1-1+lenny8_i386, tested on lenny10_386)
2. backup file usr/lib/php5/20060613+lfs/gd.so
3. replace usr/lib/php5/20060613+lfs/gd.so with file downloaded in step 1
4. block updating gd when use apt-get upgrade:
echo “php5-gd hold” | dpkg –set-selections
(unblock: echo “php5-gd install” | dpkg –set-selections)
5. /etc/init.d/apache2 restart
6. now imagerotate() must work

Leave a Reply