Jump to content

php and gd question


Recommended Posts

Hi,

 

I am running CentOS Linux ver 4.4 and found that I have "gd-devel-2.0.28-4.4E.1" package installed. This is a GD library, I supposed. However when I generate the result from phpinfo(), I cannot find the GD section. In addition, when I tried to call gd_info() in the code, it gives error message " undefined function ..." I thought, since "gd-devel-2.0.28-4.4E.1" is installed, I should be able to use GD function. But obviously I am wrong. How can I let php to use GD in my scenario? Thanks.

 

Regards,

 

Link to comment
Share on other sites

Somehow you have to get the package file.  Yum allows automatic retrieval of .rpm files from one or more repositories, but you can also grab the .rpm files manually and install them with yum or rpm.  However, I don't see how you can get them if you don't have internet access.

Link to comment
Share on other sites

In fact, I have internet at my PC where I can download the rpm.  I have downloaded this php-gd-5.2.6-2.i386.rpm  and run rpm -ivh on this rpm file. However, I got error message of dependancies of a lot of files.  I think the depended files are already installed in my linux. But still give me complaints. Can anyone please help? Thanks.

 

Link to comment
Share on other sites

I understand. However, it really happened that I could find file required existed in another directories but rpm cannot recognize it. Is there a path variable which I should set? Otherwise, how does system where to look for the depencies files? Thanks.

 

Link to comment
Share on other sites

I'm not sure how rpm works exactly but most package managers keep a cache of installed applications or they look where the dependencies should be to see if they are there at install time. All an rpm file is is an archive containing all the relevent binaries + some meta data telling the system where to put them and what (if any) configuration changes need to be made.

 

Maybe these dependencies that your sure are there where installed manually not using the package manager? This would prevent the package manager from knowing of there existence. Its generally not the best practice to mix a system with packages installed by a package manager and software installed manually unless you really know what you are doing.

 

The dependencies that you say you have, are they in the location that rpm expects them to be in? Try....

 

rpm -qpR php-gd-5.2.6-2.i386.rpm

 

To see what you require and the location they should be in. If this outputs that you require /usr/bin/foo (package manager installed) and you indeed have /usr/local/bin/foo (manually installed) installed you may be able to fix the issue using symlinks.

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.