Installing the GD Library

Source: Internet
Author: User
Tags mkdir

The GD library is actually made up of 5 components.
Which of the 5 (the GIF has been removed, or 6).
Zlib jpeg6 libpng FreeType libxml2 are composed of these 5 components. Each component I will explain its role.
Zlib is actually related to the above gzip, that is, to fully use the DEFLATE function, and enable gzip, you must zlib library support.

Jpeg6 is related to the JPEG image generated by the authentication code.

Libpng is related to the PNP image generated by the authentication code.

Libxml2 How to say, heard what is called XML Standard and XML file, LIBXML2 is responsible for parsing it.

FreeType is the verification code to generate the font on the picture. If you want to support more fonts on the CAPTCHA picture, you need to install FreeType

Okay, we're done with 5 components.
The following start is the whole, how to install.
Linux installation can really make me very headache, yes. That's true. Especially if you keep your eyes open. The parameters behind the compilation.

Please be sure to install in order, for example, must be the status quo zlib, or libpng will be loaded when the problem.

Install zlib-1.2.3

Tar zxvf zlib-1.2.3.tar.gz
CD zlib-1.2.3
/configure #首先很多网上教程都是误导, as long as the designated--prefix path, basically to the back of the GD library to install the normal compiler, I do not know why, in short, by default path installation bar.
Make
Make install


Install Jpeg6
Create a directory:
mkdir/usr/local/jpeg6/
mkdir/usr/local/jpeg6/bin/
mkdir/usr/local/jpeg6/lib/
mkdir/usr/local/jpeg6/include/
mkdir/usr/local/jpeg6/man/
mkdir/usr/local/jpeg6/man1/
Mkdir/usr/local/jpeg6/man/man1/#记住啊, the last "/" symbol of the file must not forget, otherwise it is not to create a directory, if you are a person with amnesia, then please add the-p parameter after the mkdir command.
Cd/usr/local/src
TAR-ZVXF jpegsrc.v6b.tar.gz
CD jpeg-6b
/configure--prefix=/usr/local/jpeg6/--enable-shared--enable-static #一定要加后面的参数, otherwise there is no way to generate a shared library.
Make && make install
Make Install-lib #最后一步别忘了啊 ... Remember.




Install libpng
TAR-ZVXF libpng-1.2.24.tar.gz #这里我要说一下版本好, earlier versions, such as 1.2.10, were not at all./configure this file. So to manually build the file, scary ah. The Scripts directory
Makefile.linux to the installation directory and renamed to makefile (note the case) and use VI to modify the makefile installation path (originally makefile this file is required to use the./configure generated).
CD libpng-1.2.24
/configure #这是问题之所在, like zlib, cannot specify the directory, otherwise the compilation will have the problem, strange. or install it by default.
Make && make install





Install FreeType
Cd/usr/local/src
TAR-ZVXF freetype-2.3.5.tar.gz
CD freetype-2.3.5
mkdir/usr/local/freetype/
./configure--prefix=/usr/local/freetype/
Make && make install



Install libxml2-2.6.30

TAR-ZXF libxml2-2.6.30.tar.gz

CD libxml2-2.6.30
./configure
Make && make install
CP Xml2-config/usr/bin




Installing the GD-2.0.35 Library

TAR-ZVXF gd-2.0.35.tar.gz
Mkdir-p/USR/LOCAL/GD
CD gd-2.0.35
./configure--prefix=/usr/local/gd--with-jpeg=/usr/local/jpeg6/--with-png-dir=/usr/local/lib/--with-zlib- with-freetype=/usr/local/freetype/--with-libxml-dir=/usr/local/lib/#一个字符都不能错哦.
You are doing the next step until you report the following message.
#** Configuration Summary for GD 2.0.35:

Support for PNG Library:yes
Support for JPEG Library:yes
Support for Freetype 2.x Library:yes
Support for Fontconfig Library:yes
Support for XPM Library:yes
Support for Pthreads:yes
##########################################


Make && make install
CP Gd.h/usr/local/lib #将生成的头文件拷贝到lib目录下, otherwise there will be an error

Finally, the GD library installation finished, this time remember Ah, the following start compiling PHP, remember to compile them all in OH.




Installing PHP
1. Implementation of the Cd/usr/down #这个不想说

www.ixdba.net


2. Implementation of the TAR-ZXVF php-5.2.1.tar.gz #这个更不想说
3. Perform CD php-5.2.1 # ...
4. Implementation./configure--prefix=/server/php/--with-mysql=/server/mysql/--with-apxs2=/server/apache/bin/apxs-- with-jpeg-dir=/usr/local/jpeg6/--with-libxml-dir=/usr/local/lib/--with-zlib--with-gd=/usr/local/gd/--with-ttf= /usr/local/freetype/--with-png-dir=/usr/local/lib/#这个要稍微说明下, you also see, followed by a large pile of parameters, before the wrong Oh, otherwise the directory of the configuration file can be wrong, will be very troublesome.
Parameters do not need me to explain it, you should be able to read.
5. Execute Make #还是 ...
6. Execute make install #.
7. Execute CP Php.ini-dist/usr/local/lib/php.ini #先说明下, php.ini-dist What is this file, this is a ready to write a ready-made php configuration file. We mean we need to call and modify it, and now we just put the out-of-the-box configuration file in its place, so copy this profile over. Ok? Oh, yes, forget to say something, if you want your PHP to have a more secure line, it is recommended to use the php.ini-recommended profile, which is more secure than php.ini-dist (some of the configurations are very good)
OK, OK, PHP is also installed.


Configure Apache associated PHP
Next, we start to change the Apache and PHP configuration files, so that they have a "close" relationship between them, you are right.
1. Implementation of the vi/server/apache/conf/httpd.conf #这是Apache的配置文件.
VI Editor We should all use it, yes, as simple as using Notepad in Windows. So this side I will not be careful to explain, the exemption of some of the master has the "more than the laceless of the smelly cloth still longer" feeling.
3. Enter the/loadmodule #查找到有关LoadModule字母的位置.
4. We can see the LoadModule php5_module modules/libphp5.so #这样就对了, if there is "#" in front of it, then this annotation symbol is removed:.
5. Input/addtype
6. We can see AddType application/x-gzip. tgz    #

The

also removes this annotation, allowing the server to support gzip compression, which can greatly reduce server bandwidth and execution efficiency OH.
7. Click I to insert edit mode
8. Move the cursor after AddType application/x-gzip. tgz. Join a line AddType application/x-httpd-php. php & nbsp;     #这就是我们要修改的地方, you want to add a parameter. This will support PHP.
9. Click Esc. Back to VI command line mode.
and enter/directoryindex
10. Click the I key to enter the insert edit mode. And in DirectoryIndex index.html
ixdba.net Community forum
followed by a space and then add index.php
OK, Apache configuration file is done, the following start to engage in PHP configuration file, the light Apache "single Acacia" Can not oh, to both sides have "meaning" just go, haha.
11.  vi/usr/local/lib/php.ini
looks for register_globals = off, changes off to on
and then finds Short_open_tag = off, Change off to on
in the lookup extension=php_mbstring.dll to the front "#" number, so as to start the function of this parameter.
For example, to enable PHP to support MySQL, it is necessary to extension=php_mysql.dll in front of the "#" removed.
I am all removed anyway, we press the request to open the function bar.

Memory_limit = 20m   memory capacity
Post_max_size = 20m   Flash capacity
Upload_max_filesize = 1m&nbs p;  attachment Capacity
These look at your meaning casually set (it is best to see your server level and bandwidth quality), I anyway attachment only open 1M. (Of course, also in the DZ forum to set the line)


Line, the last difference phpMyAdmin and Zend (full name

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.