实战Linux下Apache2+GD+ZEND

王朝system·作者佚名  2006-12-16
窄屏简体版  字體: |||超大  

Apache2

# cd /usr/src

# tar zxvf /home/install/httpd-2.x.x.tar.gz

# cd /usr/src/httpd-2.x.x

# make clean

# ./configure –prefix=/usr/local/httpd –-enable-so –enable-rewrite

# make

# make indtall

设置apache开机自起

Freetype

# cd /usr/src

# tar zxvf /home/install/freetype-2.1.4.tar.gz

# cd /usr/src/freetype-2.1.4

# mkdir /usr/local/freetype

# make clean

# ./configure --prefix=/usr/local/freetype

# make

# make install

zlib

# cd /usr/src

# tar zxvf /home/install/zlib-1.1.4.tar.gz

# cd /usr/src/zlib-1.1.4

# mkdir /usr/local/zlib

# make clean

# ./configure --prefix=/usr/local/zlib

# make

# make install

开始按那文档安装,还比较顺利,但安装到gd-2时,我发现没有找到这

/usr/local/freetype/include/freetype2/freetype/freetype.h

文件,一查,发现/usr/local/freetype/整个目录下空空的.

我从新检查freetype的安装过程.

发现在运行 ./configure --prefix=/usr/local/freetype 时提示如下信息

FreeType build system -- automatic system detection

The following settings are used:

platform unix

compiler cc

configuration directory ./builds/unix

configuration rules ./builds/unix/unix.mk

If this does not correspond to your system or settings please remove the file

`config.mk' from this directory then read the INSTALL file for help.

Otherwise, simply type `make' again to build the library,

or `make refdoc' to build the API reference (the latter needs python).

make: Nothing to be done for `unix'.

于是,我多加一步命令 make refdoc,在make,最后在 make install

最后检查/usr/local/freetype/ 下面有许多文件了.(也不知道安装有没有问题)

在回到gd2的安装

更改/usr/local/freetype/include/freetype2/freetype/freetype.h的内容后,

再运行make还是发现出现以下的错误.

from gdft.c:59:/usr/local/freetype/include/freetype2/freetype/freetype.h:19:36: /usr/includee/ft2build.h: No such file or directory

In file included from /usr/local/freetype/include/freetype2/freetype/freetype.h:20,

make[2]: *** [gdft.lo] Error 1

make[2]: Leaving directory `/home/HFei/gd-2.0.28'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/home/HFei/gd-2.0.28'

make: *** [all] Error 2

这是怎么问题呢?

libpng

# cd /usr/src

# tar zxvf /home/install/libpng-1.2.5.tar.gz

# cd /usr/src/libpng-1.2.5

# mkdir /usr/local/libpng

# make clean

# cp scripts/makefile.linux makefile

修改/usr/src/libpng-1.2.5/makefile文件的以下三句

prefix=/usr/local/libpng

ZLIBLIB=/usr/local/zlib/lib

ZLIBINC=/usr/local/zlib/include

# make

# make install

jpeg

# cd /usr/src

# tar zxvf /home/install/jpegsrc.v6b.tar.gz

# cd /usr/src/jpeg-6b

# mkdir /usr/local/jpeg

# make clean

# ./configure --prefix=/usr/local/jpeg

# make

# mkdir /usr/local/jpeg/bin

# mkdir /usr/local/jpeg/include

# mkdir /usr/local/jpeg/lib

# mkdir /usr/local/jpeg/man

# mkdir /usr/local/jpeg/man/man1

# make install

# make install-lib

# make install-headers

gd-2

# cd /usr/src

# tar zxvf /home/install/gd-2.0.15.tar.gz

# cd /usr/src/gd-2.0.15

# mkdir /usr/local/gd

# make clean

# ./configure --prefix=/usr/local/gd --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype --with-jpeg=/usr/local/jpeg

打开/usr/local/freetype/include/freetype2/freetype/freetype.h

删除#ifndef FT_FREETYPE_H

#error "`ft2build.h' hasn't been included yet!"

#error "Please always use macros to include FreeType header files."

#error "Example:"

#error " #include <ft2build.h>"

#error " #include FT_FREETYPE_H"

#endif

加入:#include </usr/includee/ft2build.h>

#include FT_FREETYPE_H

# make

# make install

PHP

# cd /usr/src

# tar zxvf /home/install/php-4.3.2.tar.gz

# cd /usr/src/php-4.3.2

# mkdir /usr/local/php

# make clean

#./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-xmlrpc --with-mysql=/usr/local/mysql --with-gd=/usr/local/gd --with-jpeg-dir=/usr/local/jpeg --with-png-dir=/usr/local/libpng --with-zlib-dir=/usr/local/zlib --with-freetype-dir=/usr/local/freetype --disable-cgi --with-config-file-path=/usr/local/php --enable-track-vars --with-tsrm-pth

# make

# make install

Apache: /usr/local/apache2/conf/httpd.conf

LoadModule php4_module modules/libphp4.so

AddType application/x-httpd-php .php .phtml

AcceptPathInfo On (para las librerias xcs de xml-rpc)

apache启动时提示/usr/local/apache2/modules目录下没有libphp4.so文件,是否要

cp /usr/src/php-4.3.8/libs/libphp4.so /usr/local/apache2/modules

zend

下载ZendOptimizer-2[1].5.5-linux-glibc21-i386.tar

#tar zxvf ZendOptimizer-2[1].5.5-linux-glibc21-i386.tar

进入解压后的目录。拷贝php源码中的php.ini-dist 到编译php时指定的目录(php.ini的路径在编译php时的./configure中指定为--with-config-file-path=/usr/local/php)

#cp php.ini-dist /usr/local/php

#./install

按提示操作,选择默认安装路径/etc/locate/Zend.要求输入php.ini路径(php.ini的路径在编译php时的./configure中指定为--with-config-file-path=/usr/local/php)

#service apachectl stop

#service apachectl start

#vi info.php

输入如下内容:

<?php

phpinfo();

?>

检查zend是否起来。

Apache模块

Apache是模块化的服务器,核心服务器种只包含了功能最常用的模块,而扩展功能由其他模块提供。设置过程中,你必须指定需要包含的模块。文档中有模块清单备查,其中状态为"Base"的模块会被默认地包含进核心服务器,如果你不需要包含某个模块(比如mod_userdir),则必须明确地禁用它;其他状态的模块(比如mod_expires),也必须明确启用以使之包含进核心服务器。

Apache有两种使用模块的方法,其一是永久性包含进核心;如果操作系统支持动态共享对象(DSO),而且能为autoconf所检测,则模块还可以被动态编译。DSO模块的存储是独立与核心的,可以被核心使用由mod_so模块提供的运行时刻配置指令包含或排除。如果编译中包含有任何动态模块,则mod_so模块会被自动包含进核心。如果希望核心能够装载DSO,而不实际编译任何动态模块,需要明确指定--enable-so。

--enable-MODULE[=shared]

编译并包含模块MODULE。MODULE是文档中去掉"_module"的模块名。要将一个模块编译成DSO,需要加=shared选项。

--disable-MODULE

排除可能被编译并包含的模块MODULE。

--enable-modules=MODULE-LIST

编译并包含用空格分隔的MODULE-LIST。

--enable-mods-shared=MODULE-LIST

编译并包含用空格分隔的MODULE-LIST成DSO。

--enable-modules和--enable-mods-shared中的MODULE-LIST选项通常是一个用空格分隔的模块列表,例如编译并包含enable mod_dav and mod_info,可以

./configure --enable-dav --enable-info

或者,等效地写成:

./configure --enable-modules="dav info"

另外,可以用关键字all或most一次性包含“所有的”或者“大多数”模块,然后再用--disable-MODULE来排除你不需要的模块。例如,包含所有的模块为DSO,而排除mod_info,可以

./configure --enable-mods-shared=all --disable-info

除了标准模块组,Apache 2.0还提供了一个选择,就是多道处理模块(Multi-Processing Modules)(MPMs)。编译过程中必须包含一个且只有一个MPM,MPM documentation page有对应各种平台的默认MPM,但是也可以在configure命令行中改变。

--with-mpm=NAME

选择叫NAME的MPM.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航