-
- # tar xvzf zlib-1.2.3.tar.gz
- # cd zlib-1.2.3
- # ./configure
- # make && make install
Copy the code
3. Install freetype
-
- # tar xvzf freetype-1.3.1.tar.gz
- # cd freetype-1.3.1
- # ./configure --prefix=/usr/local/freetype
- # make && make install
-
Copy the code
There are multiple lines of errors similar to: ftdump.c:172:1: error: pasting "." and "glyph_object" does not give a valid preprocessing token
Solution: Modify the code in test/ftdump.c:
Change Print_Mem( memory_footprint.##field, string ) to: Print_Mem( memory_footprint.field, string )
Change #define FOOTPRINT( field ) Save_Memory( &memory_footprint.##field ) to: #define FOOTPRINT( field ) Save_Memory( &memory_footprint.field )
Remake && make install
Or modify Makefile.in:
-
- 1. Remove all: tttest in ttlib tttest ttpo
- 2. Delete
- install:
- cd $(FTLIBDIR); $(MAKE) -f $(MAKEFILE) install
- cd $(FTTESTDIR); $ (MAKE) -f $(MAKEFILE) install
- cd $(FTPODIR); $(MAKE) install
- cd $(FTTESTDIR); $(MAKE) -f $(MAKEFILE) install
- # ./configure --prefix =/usr/local/freetype
- # make && make install
-
Copy code
4. Install libpng
-
- # tar xvzf libpng-1.5.2.tar.gz
- # cd libpng-1.5.2
- # ./configure --prefix=/usr/local/libpng
- # make && make install
Copy the code
5. Install jpegsrc
-
- # tar xvzf jpegsrc.v6b.tar.gz
- # cd jpegsrc.v6b
- # ./configure --prefix=/usr/local/jpeg6 –enable-shared –enable-static
- # make && make install
-
Copy code
Possible error: The prompt folder does not exist. It should be that the program cannot automatically create the folder. According to the error prompt, just create the file manually with mkdir.
This time for example:
-
- # mkdir -p /usr/local/jpeg6/include/
- # mkdir -p /usr/local/jpeg6/lib/
- # mkdir -p /usr/local/jpeg6/bin/cjpeg
- # mkdir -p /usr/local/jpeg6/man/man1/
Copy the code
6. Install gettext (some have it directly, you can install the GD library first, report an error and then return to install it)
-
- # tar xvzf gettext-0.16.1.tar.gz
- # cd gettext-0.16.1
- # ./configure --prefix=/usr/local/gettext
- # make && make install
Copy the code
7. Install the GD library
-
- # tar xvzf gd-2.0.35.tar.gz
- # cd gd-2.0.35
- # ./configure --prefix=/usr/local/gd --with-jpeg=/usr/ local/jpeg6 --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype
- # make
- # make install
-
Copy code
configure...This step is possible Error: configure.ac:64: error: possibly undefined macro: AM_ICONV, you must install gettext (discussed in step 6)
8. Generate gd.so
-
- # cd ../php-5.2.17/ext/gd/
- #/usr/local/php5/bin/phpize
- #./configure --with-php-config=/usr/local /php5/bin/php-config --with-jpeg-dir=/usr/local/jpeg6/ --with-png-dir=/usr/local/libpng/ --with-gd=/usr/local/gd / --with-freetype-dir=/usr/local/freetype/
- # make && make install
-
Copy the code
At this time, at the end of make install, there will be the location where the gd library is stored, from that folder Copy gd.so to the extension library directory
9. Modify PHP.ini
Add the following content to php.ini
10. After the installation is completed, restart the Apache service
|