Jump to content

Configuring PHP to use GD2


Recommended Posts

Good afternoon,

I'm trying to get GD2 installed on a SunOS (Solaris 10) machine, running a cut down version of PHP 4.3.9 (Bundled with Oracle Application Server).

PHP wasn't complied with GD as default, so now I want to try and get it running.  From what I understand I need a php_gd2.so file for the box and I then need to uncomment the line in the php.ini file.  Does anyone know where I can get this file from?

Regards
Huggie
Link to comment
Share on other sites

Thanks Thorpe, but that's no good.  I need the .so pre-compiled on a SPARC Solaris 10 machine for me, as my Unix Administrator won't recompile php after the problems we had last time with it.

I'm going to attempt to install a separate instance of php on the box, compile it and then copy the .so over, but wondered if anyone else had one first.

Regards
Huggie
Link to comment
Share on other sites

Your admin should be able to compile the library without having to worry about affecting the current install. The procedure should be similar to the linked to example.

http://www.phpfreaks.com/forums/index.php/topic,108344.0.html

You may be able to use google to find a more complete guide on how to compile shared php modules.
Link to comment
Share on other sites

Note first that the instructions are for creating a shared library for an already installed version of php. If that is the case then everything is to be done inside "php-version/ext/gd" (php-version should be "php-4.3.9" in your case). No "make install" needs to be done. I usually copy the files and change the php.ini manually to ensure that nothing is affected.

The Makefile should have been created after doing "./configure --with-gd=shared". If there is none then check to see if the "configure" failed.

Keep in mind that I've never used Solaris but seeing how php uses the autoconf system there should not be much (if any) difference in what needs to be done.

If this is not being done on the same box as the one that you're ultimately putting the "so" file on, then I can't guarantee that it'll work after being put on the box.

As a side note. To create the gd.so when compiling php for the first time you'll run configure in the "php-version" directory adding "--with-gd=shared" to the configure line. After "make" the gd.so should be in
"php-version/modules"

Remove and re-extract the .tar.gz and try again. If you're still having problems post the commands you ran in the order you did them.

EDIT: changed wording of part of the comment.
Link to comment
Share on other sites

OK, this is now solved...

I changed the configure command to the following to include a link to the math library...

[code]LDFLAGS='-lm' ./configure --with-gd=shared --enable-gd-native-ttf --with-ttf[/code]

and it worked perfectly.

Thanks for your help shoz.

Regards
Huggie
Link to comment
Share on other sites

  • 9 months later...
Huggiebear,

So from your last posts,it seems that you have succesfully configured GD.
I am also having the same env as urs.
Can you help me in this?
1.) where do i meant to check whether GD.so is already there in the box?
2.) If not present,do i have to download it and copy it somewhere.

Thanks in advance for the help
Link to comment
Share on other sites

This thread is more than a year old.

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.

 Share

×
×
  • 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.