SUSE LINUX 安装Apache2 + PHP5 (普通安装,不是yum)

 

一、Apache2


1.安装APR apr-1.4.6.tar.gz

#tar -zxf apr-1.4.6.tar.gz
#./configure --prefix=/usr/local/services/apr
#make
#make install


错误:rm: cannot remove `libtoolT': No such file or directory 
忽略

2.安装APR-util apr-util-1.4.1.tar.gz

#tar -zxf apr-util-1.4.1.tar.gz
#./configure --prefix=/usr/local/services/apr-util --with-apr=/usr/local/services/apr/bin/apr-1-config
#make
#make install

3.安装PCRE pcre-8.30.zip

#unzip -o pcre-8.30.zip
#./configure --prefix=/usr/local/services/pcre
#make
#make install

4.安装Apache2 httpd-2.4.2.tar.gz

#tar -zvxf httpd-2.4.2.tar.gz
#./configure --prefix=/usr/local/services/apache2 --with-apr=/usr/local/services/apr/ --with-apr-util=/usr/local/services/apr-util/ --with-pcre=/usr/local/services/pcre/
#make
#make install
A.修改conf配置

路径为当前Apache安装目录/conf/httpd.conf

访问端口

主机名

B.启动Apache
#/usr/local/services/apache2/bin/apachectl start

重启restart 停止stop

C.检查端口是否成功开启
 #netstat -tnlp 


D.

二、MYSQL

三、PHP5

1.安装JPEG6 jpegsrc.v6b.tar.gz

# mkdir -p /usr/local/services/jpeg6 
# mkdir -p /usr/local/services/jpeg6/bin 
# mkdir -p /usr/local/services/jpeg6/lib 
# mkdir -p /usr/local/services/jpeg6/include 
# mkdir -p /usr/local/services/jpeg6/man 
# mkdir -p /usr/local/services/jpeg6/man1
# mkdir -p /usr/local/services/jpeg6/man/man1

# tar -zvxf jpegsrc.v6b.tar.gz
# CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/local/services/jpeg6/ --enable-shared --enable-static
# make
# make install

 

问题:jpeg6 make: ./libtool:命令未找到

解决:拷贝libtool文件到jpeg6安装文件目录

问题:x86_64-unknown-linux-gnu

解决:拷贝libtool文件到jpeg6文件目录(注意是安装包目录)

 

2.安装LIBpng libpng-1.2.8.tar.gz

# tar -zvxf libpng-1.2.8.tar.gz
# cd libpng-1.2.8
# cp scripts/makefile.std makefile 
# vi makefile

在CFLAGS加入-fPIC

 

# make
# make install 

3.安装Freetype freetype-2.4.4.tar.gz

# tar -zvxf freetype-2.4.4.tar.gz 
# cd freetype-2.4.4
# ./configure --prefix=/usr/local/services/freetype 
# make
# make install

 

问题:make: Nothing to be done for `unix'.忽略

4.安装Zlib zlib-1.2.5.tar.gz

# tar -zxvf zlib-1.2.5.tar.gz
# ./configure --prefix=/usr/local/services/zlib/
# make
# make install

问题:zlib/lib/libz.a: could not read symbols: Bad value

解决:在CFLAGS加入 -fPIC

5.安装GD GD-2.0.33.tar.gz

# tar -zxvf GD-2.0.33.tar.gz
# ./configure --prefix=/usr/local/services/gd2/ --with-jpeg=/usr/local/services/jpeg6/ --with-png=/usr/local/services/lib/ --with-zlib=/usr/local/services/zlib --with-freetype=/usr/local/services/freetype

显示

  Configuration summary for gd 2.0.33:
   Support for PNG library:          yes
   Support for JPEG library:         yes
   Support for Freetype 2.x library: yes
   Support for Fontconfig library:   no
   Support for Xpm library:          no
   Support for pthreads:             yes
# make
# make install

 

错误:/lib/libjpeg.a(jcapimin.o): could not read symbols: Bad value

解决:安装jpeg6的时候,加上CFLAGS="-O3 -fPIC"参数

6.安装Curl curl-7.19.4.tar.gz

# tar -zxvf curl-7.19.4.tar.gz
# ./configure --prefix=/usr/local/services/curl
# make
# make install

7.安装Libxml libxml2-2.7.7.tar.gz

# tar -zxvf libxml2-2.7.7.tar.gz
# ./configure --prefix=/usr/local/services/libxml2 --with-zlib=/usr/local/services/zlib/
# make
# make install

问题:“bin/rm: cannot remove `libtoolT': No such file or directory”
解决:

# aclocal
# autoconf
# automake
# libtoolize --force

问题:./.libs/libxml2.so: undefined reference to `gzopen64' 
解决:vi编辑Makefile文件,然后在CFLAGS后面添加 -fPIC 参数

8.安装PHP php-5.3.10.tar.gz

# tar -zxvf php-5.3.10.tar.gz
#  ./configure --prefix=/usr/local/services/php/ --with-apxs2=/usr/local/services/apache2/bin/apxs --with-libxml-dir=/usr/local/services/libxml2/ --with-gd=/usr/local/services/gd2/ --with-jpeg-dir=/usr/local/services/jpeg6/ --with-zlib-dir=/usr/local/services/zlib/ --with-png-dir=/usr/local/lib --with-freetype-dir=/usr/local/services/freetype/ --with-curl=/usr/local/services/curl --enable-ftp 
A.拷贝配置文件
# cp php.ini-production /usr/local/services/php/lib/php.ini
B.修改Apache2配置httpd.conf

在AddType application/x-gzip .gz .tgz 插入如下内容
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

C.创建测试文件,扩展名PHP
<?php
phpinfo();
?>
D.重启Apache
#/usr/local/services/apache2/bin/apachectl restart



 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值