freetds mysql_apache+mysql+php+gd+freetds
1. apache安裝:
#yum –y install *gcc*//安裝gcc環(huán)境
#tar –zxvf http-*.tar.gz
#cd http-*
#./configure –prefix=/usr/local/apache2 –enable-so –enable-rewrite
#make && make install
設(shè)置開機(jī)自動(dòng)啟動(dòng)
從/usr/local/apache/bin/apachectl 到 /etc/rc.d/init.d/httpd 建立一個(gè)符號(hào)連接:
# ln -s /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
然后在此文件總添加以下幾行(大概在文件頂部,約第二行的地方):
# chkconfig: 2345 10 90
# description: Activates/Deactivates Apache Web Server
最后,運(yùn)行chkconfig把Apache添加到系統(tǒng)的啟動(dòng)服務(wù)組里面:
# /sbin/chkconfig --del httpd
# /sbin/chkconfig --add httpd
編輯/etc/rc.d/rc.local
把/usr/local/apache2/bin/apachectl start 加入進(jìn)去
2. mysq安裝:
#tar –zxvf mysql-*.tar.gz
#cd msyql-*
#useradd –M –s /sbin/nologin mysql
#yum –y install libtermcap-devel
#./configure –prefix=/usr/local/mysql –with-mysqlduser=mysql
#make
#make install
#cp support-files/my-memdium.cnf /etc/my.cnf
# /usr/local/mysql/bin/mysql_install_db --user=mysql
# chown -R root:mysql /usr/local/mysql/
#chown –R mysql /usr/local/mysql/var/
#echo “/usr/local/mysql/lib/mysql” >>/etc/ld.so.conf
#ldconfig
#/usr/local/mysql/bin/mysqld_safe –user=mysql &? //啟動(dòng)mysql
開機(jī)啟動(dòng)
#cd mysql-*
# cp support-files/mysql.server /etc/init.d/mysqld
#chmod +x /etc/init.d/mysqld
#chkconfig –add mysqld
#chkconfig mysql on
# export PATH=$PATH:/usr/local/mysql/bin/
# echo "PATH=$PATH:/usr/local/mysql/bin/" >> /etc/profile
3. gd安裝:
安裝ZLIB2
tar -zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure –prefix=/usr/local/zlib
#################################################
不要用--prefix自定義安裝目錄,否則可能會(huì)影響后面安裝,可能出現(xiàn)的錯(cuò)誤:
configure: error: zlib not installed
#################################################
#################################################
如果你的機(jī)器是64位,并且在安裝png時(shí)候出現(xiàn)下面錯(cuò)誤:
/usr/bin/ld: /usr/local/lib/libz.a(compress.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libz.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
修補(bǔ)辦法(接上面步驟):
vi Makefile
找到 CFLAGS=-O3 -DUSE_MMAP
在后面加入-fPIC,即變成CFLAGS=-O3 -DUSE_MMAP -fPIC
接下面步驟
#################################################
make
make install
安裝JPEG6
#################################################
先建立目錄,否則可能會(huì)出現(xiàn)類型下面錯(cuò)誤:
/usr/bin/install -c cjpeg /usr/local/ /jpeg6
/usr/bin/install: cannot create regular file `/usr/local /jpeg6/bin/cjpeg’: No such file or directory
make: *** [install] Error 1
解決辦法:
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
#################################################
cd /home/biaoest
tar -zxvf jpegsrc.v6b.tar.gz
cd jpegsrc.v6b.
./configure --prefix=/usr/local/ jpeg6
#################################################
如果你的機(jī)器是64位,并且在安裝gd時(shí)候出現(xiàn)下面錯(cuò)誤:
/usr/bin/ld: /usr/local/jpeg6/lib/libjpeg.a(compress.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
/usr/local/jpeg6/lib/libjpeg.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [libgd.la] Error 1
修補(bǔ)辦法(接上面步驟):
vi Makefile
找到 CFLAGS= -O2 -I$(srcdir)
在后面加入-fPIC,即變成CFLAGS= -O2 -I$(srcdir) -fPIC
接下面步驟
#################################################
make
make install-lib
#################################################
特別注意,要不下面會(huì)出現(xiàn)錯(cuò)誤:
configure: error: libjpeg.(a|so) not found.
#################################################
make install
安裝PNG
tar -zxvf libpng-1.2.10.tar.gz
cd libpng-1.2.10
./configure --prefix=/usr/local/libpng
make
################################################
如果出現(xiàn)下面錯(cuò)誤:
configure: error: zlib not installed
請(qǐng)回到zlib,重新安裝一次,最佳先 make clean
################################################
make install
安裝freetype
tar -zxvf freetype-2.2.1.tar.gz
cd freetype-2.2.1
./configure --prefix=/usr/local/freetype
make
make install
安裝GD
tar -zxvf gd-2.0.33.tar.gz
cd gd-2.0.33
./configure--prefix=/usr/local/gd
--with-jpeg=/usr/local/jpeg6/
--with-png=/usr/local/libpng/
--with-zlib=/usr/local/zlib
--with-freetype=/usr/local/ freetype/
make
#################################################
如果出現(xiàn)下面錯(cuò)誤:
gd_png.c:825: warning: data definition has no type or storage class
make[2]: *** [gd_png.lo] Error 1
修復(fù)方法:
找到CPPFLAGS=-I/usr/local /freetype/include/freetype2 -I/usr/local/apache2/modlib/freetyp
e/include -I/usr/local/ /freetype/include -I/usr/local /jpeg6/include
原來是少了png的支持了,把他改為
CPPFLAGS=-I/usr/local /freetype/include/freetype2-I/usr/local /freetyp
e/include -I/usr/local/libpng /include -I/usr/local /jpeg6/include
#################################################
make install
安裝LIBXML2
tar -zxvf libxml2-2.6.26.tar.gz
cd libxml2-2.6.26
./configure --prefix=/usr/local/xml2
make
make install
安裝freetds
#tar –zxvf freetds-*.tar.gz
#cd freetds-*
#./configure?--prefix=/usr/local/freetds?--with-tdsver=8.0?--enable-msdblib? --enable-static
#make && makeinstall
4. php安裝
#tar –zxvf php-*.tar.gz
#cd php-*
#./configure
--prefix=/usr/local/php
--with-apxs2=/usr/local/apache2/bin/apxs
--with-mysql=/usr/local/mysql
--with-libxml-dir=/usr/local/xml2
--with-png-dir=/usr/local/libpnng
--with-jpeg-dir=/usr/local/jpeg6
--with-zlib
--with-freetype-dir=/usr/local/freetype
--enable-pdo
--with-pdo-sqlite
--with-pdo-mysql=/usr/local/mysql/bin/mysql_config
--with-pdo-dblib=/usr/local/freetds/
--with-gd=/usr/local/gd
--with-curl
--with-mssql=/usr/local/freetds/
--disable-debug
--enable-sockets
--enable-force-cgi-redirect
--enable-calendar
--enable-magic-quotes
--enable-ftp
--enable-gd-native-ttf
--with-ttf --with-gdbm
--with-iconv --enable-mbstring=all
報(bào)錯(cuò)1
checking if we should use cURL for url streams... no
checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution -
easy.h should be in /include/curl/
需要安裝:yum -y install curl*
報(bào)錯(cuò)2
checking for strftime... (cached) yes
checking for QDBM support... no
configure: error: DBA: Could not find necessary header file(s).
需要安裝:yum -y install php-dba.i386 php-dbase.i386 gdbm-devel
報(bào)錯(cuò)3
checking for MSSQL support via FreeTDS... yes
configure: error: Directory /usr/local/freetds/ is not a FreeTDS installation directory
解決辦法:
就是php找不到freetds的安裝路徑
其實(shí)是
PHP檢測(cè)其安裝目錄的時(shí)候有些問題,檢查依據(jù)是兩個(gè)已經(jīng)不用的文件,創(chuàng)建兩個(gè)空文件就OK
touch /usr/local/freetds/include/tds.h
touch /usr/local/freetds/lib/libtds.a
報(bào)錯(cuò)4
checking lex output file root... ./configure: line 3246: lex: command not found
configure: error: cannot find output from lex; giving up
修補(bǔ)方法,安裝FLEX:
rpm -Uvh flex-2.5.4a-33.x86_64.rpm
報(bào)錯(cuò)5
configure: error: libjpeg.(a|so) not found.
修補(bǔ)方法:
原來在安裝jpeg的時(shí)候,執(zhí)行了make install,應(yīng)該執(zhí)行make install-lib才能生成libjpeg.a文件
#make
#make install
#cp php.ini-dict /usr/local/php/lib/php.ini
#vim /usr/local/apache2/conf/httpd.conf
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
DirectoryIndex index.php index.html
//紅色的字是增加的
5. 測(cè)試php
#vim /usr/local/apache2/htdocs/index.php
phpinfo();
?>
#serveric apache stop
#serveric apache start
總結(jié)
以上是生活随笔為你收集整理的freetds mysql_apache+mysql+php+gd+freetds的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 三鲜汤的家常做法?
- 下一篇: 海底捞的企业文化是什么啊?