安裝zlib tar zxvf zlib-1.2.3.tar.gz cd zlib-1.2.3 ./configure --prefix=/usr/local/zlib2 make make install 安裝libpng tar zxvf libpng-1.2.10.tar.gz cd libpng-1.2.10 ./configure --prefix=/usr/local/libpng make make install 安裝freetype tar zxvf freetype-2.3.5.tar.gz cd freetype-2.3.5 ./configure --prefix=/usr/local/freetype make make install 安裝Jpeg 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/man/man1 tar zxvf jpegsrc.v6b.tar.gz cd jpeg-6b ./configure --prefix=/usr/local/jpeg6 --enable-shared make make install 安裝GD tar zxvf gd-2.0.35.tar.gz cd gd-2.0.35 ./configure --prefix=/usr/local/gd2 --with-zlib=/usr/local/zlib2/ --with-png=/usr/local/libpng/ --with-jpeg=/usr/local/jpeg6/ --with-freetype=/usr/local/freetype/ make (在make時可能會是出現以下錯誤: cd . && /bin/sh /root/gd-2.0.35/config/missing --run aclocal-1.9 -I config aclocal:configure.ac:64: warning: macro `AM_ICONV' not found in library cd . && /bin/sh /root/gd-2.0.35/config/missing --run automake-1.9 --foreign cd . && /bin/sh /root/gd-2.0.35/config/missing --run autoconf configure.ac:64: error: possibly undefined macro: AM_ICONV If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. make: *** [configure] Error 1 把報錯信息“configure.ac:64: error: possibly undefined macro: AM_ICONV”拿到google里搜索,得到“But you need to have gettext”沒有gettext這個包。 然后直接運行:yum install gettext 在做make 就好了[解決方法是在:把warning: macro `AM_ICONV' not found in library 復制到google中找到這個地址http://sery.blog.51cto.com/10037/50892] ) 安裝mysql groupadd mysql // 建立mysql組 useradd mysql -g mysql //建立mysql用戶并且加入到mysql組中 tar zxvf mysql-5.0.16.tar.gz //解壓縮 cd mysql-5.0.16 //進入解開包的目錄 ./configure --prefix=/usr/local/mysql --with-charset=gbk --with-extra-charsets=gbk,gb2312 --enable-thread-safe-client make make install cd scripts //進入到腳本目錄下 ./mysql_install_db --user=mysql //安裝庫文件,應該會提示說OK!的。 cd /usr/local/mysql //進入到安裝的mysql軟件目錄中 chown -R root . //設定root能訪問/usr/local/mysql chown -R mysql var //設定mysql用戶能訪問/usr/local/mysql/var ,里面存的是mysql的數據庫文件.這個目錄是在/etc/my.cnf中有配置,在mysql_install_db時產生。 chown -R mysql var/ . //設定mysql用戶能訪問/usr/local/mysql/var/mysql下的所有文件 chgrp -R mysql . //設定mysql組能夠訪問/usr/local/mysql # 上面的已經把mysql完全安裝完了,也能正常使用了,但還不夠,你要將mysql的數據庫啟動腳本加入系統啟動目錄 cd /usr/local/mysql/lib/mysql/ ln -s libmysqlclient.so.15.0.0 libmysqlclient_r.so