Upgrade the GD library in Ubuntu to the full version.

Source: Internet
Author: User
Tags drupal
In general, we install the LAMPP environment in the Ubuntu Linux release version directly through apt-get (convenient and lazy! Haha )! It is very convenient, but there are more or less problems in these integrated versions. For example, PHP5-GD library ~ After installation, we found that the prompt in phpinfo is 2.0orhigher. although most of the functions are available, this library is not complete. Drupal appeared in a single Xilin Drupal project.

In general, we install the LAMPP environment in the Ubuntu Linux release version directly through apt-get (convenient and lazy! Haha )!

It is very convenient, but there are more or less problems in these integrated versions.

For example, PHP5-GD library ~ After installation, we found that the prompt in phpinfo is 2.0 or higher. Although most of the functions are available, this library is not complete.

The Drupal error was reported during a Xilin Drupal project, leading to missing functions of the image module! At the beginning is still very surprised, asked a friend, a friend said should not have such a problem (later I know, he has been compiling and installing T-T ).

The error message is as follows:

GD Image Filtering and GD Image Rotation cannot work normally. The system prompts that the GD library version is not the official release version!

So I began to find this problem on the Internet and found that all Ubuntu and debian users had this problem.

Because DRUPAL is rarely used in China, the problem is not obvious. I found a solution when I went to some foreign websites. (E is too difficult to find !)

The main problem lies in the GD library. Many people say that the GD library in the APT package has been modified and then compiled and integrated. So there will be a lack of functionality. Now that the problem is found, there is a solution. I saw his solution on the Cumu. li website. The original BLOG is as follows:

I 've been installing the LAMP stack on an Ubuntu based server for a client. they rely on the version of LibGD that's bundled with PHP5. This version already des certain functions including imagerotate () and others.

It seems that the people who build Ubuntu (and Debian) distribution do not want to compile PHP5 with the version of GD that comes bundled with PHP5. As far as I can tell the guys at Ubuntu (and Debian) consider this to be a fork of the original GD library and think that this cocould be a security risk. their stance on it is that if PHP want to use this version then they shocould contribute the changes That have been made to the original GD library back to the core project. this seems fair enough, but unfortunately I can't immediately change the ction of an open source project this big-or probably any project, come to think about it!

After a bit of rummaging around und on the Internet I found nothing to do with actually compiling in this support, so I tried to work out how to do this... In theory! I found a link on Ubuntu forums about including the GMP library I roughly followed this through.

(Xilin, my E-text water adjustment will not be ugly translation! Basically, we suggest you download the source code again and then compile and package it !)

The procedure is as follows:

First download the source code package
# Install build tools, debian helpers and fakeroot
Apt-get install build-essential debhelper fakeroot
# Source code shoshould reside in/usr/src
Cd/usr/src
# Download PHP source
Apt-get source php5
# Install all packages required to build PHP5
Apt-get build-dep php5
Cd php5-5.2.3

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.