一.安装gcc
shell># yum -y install gcc
二.安装zlib压缩库
shell>## cd /home/hsk/tar
shell># tar –zxvf zlib-1.2.5.tar.gz
shell># cd zlib-1.2.5
shell># ./configure --build=arm-linux //这个配置编译命令不要加目录参数
shell># make && make install
三.安装apache
shell># cd /home/hsk/tar
shell># tar -jxvf httpd-2.2.19.tar.bz2
shell># cd httpd-2.2.19
shell>#./configure --prefix=/usr/local/http2 \
--enable-modules=all \
--enable-mods-shared=all \
--enable-so
--build=arm-linux
shell># make && make install
启动Apache
shell># /usr/local/http2/bin/apachectl start/stop/restart
四.安装libxml2
shell># cd /home/hsk/tar
shell># tar zxvf libxml2-2.7.2.tar.gz
shell># cd libxml2-2.7.2
shell>#./configure --prefix=/usr/local/libxml2 \
--without-zlib --build=arm-linux
shell># make && make install
五.安装jpeg8
shell># cd /home/hsk/tar
shell># tar -zxvf jpegsrc.v8b.tar.gz
shell># cd jpeg-8b
shell>#./configure --prefix=/usr/local/jpeg \
--enable-shared --enable-static --build=arm-linux
shell># make && make install
六.安装libpng
shell># cd /home/hsk/tar
shell># tar zxvf libpng-1.4.3.tar.gz
shell># cd libpng-1.4.3
shell>#./configure --build=arm-linux
shell># make && make install
七.安装freetype(字体库)
shell># cd /home/hsk/tar
shell># tar zxvf freetype-2.4.1.tar.gz
shell># cd freetype-2.4.1
shell>#./configure --prefix=/usr/local/freetype --build=arm-linux
shell># make && make install
八.安装GD库
shell># cd /home/hsk/tar
shell># tar -zvxf gd-2.0.35.tar.gz
shell># cd gd-2.0.35
shell>#./configure --prefix=/usr/local/gd \
--with-jpeg=/usr/local/jpeg/ \
--with-png --with-zlib \
--with-freetype=/usr/local/freetype --build=arm-linux
shell># make && make install
九.安装 php5
shell># cd /home/hsk/tar
shell># tar -jxvf php-5.3.6.tar.bz2
shell># cd php-5.3.6
shell>#./configure --prefix=/usr/local/php \
--with-apxs2=/usr/local/http2/bin/apxs \
--with-mysql=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-freetype-dir=/usr/local/freetype \
--with-gd=/usr/local/gd \
--with-zlib --with-libxml-dir=/usr/local/libxml2 \
--with-jpeg-dir=/usr/local/jpeg \
--with-png-dir \
--enable-mbstring=all \
--enable-mbregex \
--enable-shared \
--build=arm-linux
shell># make && make install
复制php.ini配置文件到指定目录
shell># cp php.ini-development /usr/local/php/lib/php.ini
配置Apache使其支持php
vi /usr/local/http2/conf/httpd.conf
- 在httpd.conf(Apache主配置文件)中增加:
AddType application/x-httpd-php .php
- 找到下面这段话:
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
在index.html 前面添加index.php
- 建立php测试网页
vi /usr/local/http2/htdocs/index.php
输入如下内容:
<?php
phpinfo();
?>
-
安装MySQL
参考本地网页版安装mysql