Jump to content

Install older php version / or use embedded GD library


Recommended Posts

Hi,

 

So I have an Ubuntu 9.10 box, with php 5.2.10 on it..

 

It used to have CentOs and php 5.0.x or 5.1.x on it.  Now, some older websites are using stuff like smarty imagetext which uses functions like

 

imagecreatetruecolor, imagecolorallocate, imagecolorallocatealpha, imagealphablending, imagefill, imagettfbbox etc!

 

They are now giving Warnings (and not working) like

<b>Warning</b>:  imagettfbbox() [<a href='function.imagettfbbox'>function.imagettfbbox</a>]: Could not read font in <b>/mnt/websites/optimalenergy/website/library/classes/3rdparty/smarty/smarty_custom_plugins/shared.imagetext.php</b> on line <b>165</b><br />

</font><font color=#ff0000><br />
<b>Warning</b>:  imagecreatetruecolor() [<a href='function.imagecreatetruecolor'>function.imagecreatetruecolor</a>]: Invalid image dimensions in <b>/mnt/websites/optimalenergy/website/library/classes/3rdparty/smarty/smarty_custom_plugins/shared.imagetext.php</b> on line <b>186</b><br />
</font><font color=#ff0000><br />
<b>Warning</b>:  imagecreatetruecolor() [<a href='function.imagecreatetruecolor'>function.imagecreatetruecolor</a>]: Invalid image dimensions in <b>/mnt/websites/optimalenergy/website/library/classes/3rdparty/smarty/smarty_custom_plugins/shared.imagetext.php</b> on line <b>187</b><br />

</font><font color=#ff0000><br />
<b>Warning</b>:  imagecolorallocate(): supplied argument is not a valid Image resource in <b>/mnt/websites/optimalenergy/website/library/classes/3rdparty/smarty/smarty_custom_plugins/shared.imagetext.php</b> on line <b>194</b><br />
</font><font color=#ff0000><br />
<b>Warning</b>:  imagecolorallocate(): supplied argument is not a valid Image resource in <b>/mnt/websites/optimalenergy/website/library/classes/3rdparty/smarty/smarty_custom_plugins/shared.imagetext.php</b> on line <b>195</b><br />
</font><font color=#ff0000><br />

<b>Warning</b>:  imagecolorallocatealpha(): supplied argument is not a valid Image resource in <b>/mnt/websites/optimalenergy/website/library/classes/3rdparty/smarty/smarty_custom_plugins/shared.imagetext.php</b> on line <b>201</b><br />
</font><font color=#ff0000><br />

 

phpInfo() says:

gd
GD Support 	enabled
GD Version 	2.0 or higher
FreeType Support 	enabled
FreeType Linkage 	with freetype
FreeType Version 	2.3.9
T1Lib Support 	enabled
GIF Read Support 	enabled
GIF Create Support 	enabled
JPG Support 	enabled
PNG Support 	enabled
WBMP Support 	enabled

 

and

imagick
imagick module 	enabled
imagick module version 	2.1.1-rc1
imagick classes 	Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator
ImageMagick version 	ImageMagick 6.5.8-10 2010-06-07 Q16 http://www.imagemagick.org
ImageMagick copyright 	Copyright (C) 1999-2010 ImageMagick Studio LLC
ImageMagick release date 	2010-06-07
ImageMagick Number of supported formats: 	0 

 

The supported number of formats = 0 ?

 

Which one is my problem here?  I tried to compile php to use the embedded gd library (the old server had that) by following http://www.howtoforge.com/recompiling-php5-with-bundled-support-for-gd-on-ubuntu

 

But I kept getting errors and it didn't seem worth it to keep trying, hence I'm asking here.

 

So, is the new php my problem?  Or the fact that GD isn't using the embedded library, or the imagick isntallation?  Please advise!

Link to comment
Share on other sites

So, here's what I did:

 

downloaded php 5.2.8 source from php.net, extracted, ran the following :

 

./configure --with-gd=shared --enable-gd-native-ttf

make

make test

make install

 

php -i | grep "5.2.8" shows that it's there, but phpInfo says otherwise?? What did I miss?

 

phpInfo says "PHP Version 5.2.10-2ubuntu6.4" which was on before I did this make install, and before I did that, I did "apt-get purge php5" .. I've rebooted twice also

Link to comment
Share on other sites

Have you configured Apache to use the manually installed version?

 

I'm still not really sure this is a wise thing to do.

What would you suggest?  Because I can't see any other solution :-/ ... (my linux experience is limited though, only been learning as I go along, since Jan 2010 )

 

And, where would I configure it to do that?  I actually dunno what it's using at the moment.  Because php5 is "apt-get purge php5" 'd, but phpInfo says it's still on that version. (5.2.10), the one I "built" was 5.2.8

 

Link to comment
Share on other sites

Ok, nevermind that.  I've got php 5.2.10 installed with the bundled GD library...

 

But the smarty imagetext still isn't working.  Only guess that I have left, is that imagemagick isn't working properly?  Reason I'm saying that, is, because from phpInfo, the "number of supported formats", is 0 ... although it is installed.  So something went wrong with the installation.

 

What would be the best/standard way to install it?  Because apt-get install php5-imagick didn't do it for me...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.