å®è£ zlib-1.2.3
./configure --enable-shared
make
make install
å®è£ libxml-2.6.3
./configure --prefix=/usr/local/libxml2 --with-zlib --with-http --enable-shared
make
make install
å®è£ gettext-0.17
 ./configure --prefix=/usr/local/gettext --enable-shared
make
make install
å®è£ png
./configure --prefix=/usr/local/png --enable-shared
make
make install
å®è£ jpeg
 ./configure --prefix=/usr/local/jpeg --enable-shared
 make
 mkdir -p /usr/local/jpeg/include
 mkdir -p /usr/local/jpeg/lib
 mkdir -p /usr/local/jpeg/bin
 mkdir -p /usr/local/jpeg/man/man1
 make install
å®è£ freetype
./configure --prefix=/usr/local/freetype --enable-shared
 make
make install
tar zxvf gd-2.0.35.tar.gz
cd gd-2.0.35
./configure --prefix=/usr/local/libgd --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype --with-jpeg=/usr/local/libjpeg --with-fontconfig=/usr/local/fontconfig
çå°ä¸é¢çä¿¡æ¯ï¼ åµåµÂ å¾å¤é½æ¾ç¤ºæ¯æäº
Support for PNG library:Â Â Â Â Â Â Â Â Â yes
Support for JPEG library:Â Â Â Â Â Â Â Â yes
Support for Freetype 2.x library: yes
Support for Fontconfig library:Â Â yes
Support for Xpm library:Â Â Â Â Â Â Â Â Â no
Support for pthreads:Â Â Â Â Â Â Â Â Â Â Â Â yes
make
make install
============================================================
apache2.2.9+mysql5+php5å¨centos-5.2ä¸çå®è£ ï¼
apache+mysql+php
解å缩mysqlå®è£ å ï¼è¿å ¥mysqlæ件夹ã
mysql5.2.6
./configure --prefix=/usr/local/mysql  --localstatedir=/var/lib/mysql  --with-comment=Source  --with-server-suffix=-Community  --with-mysqld-user=mysql  --without-debug  --with-big-tables  --with-charset=latin1  --with-collation=latin1_swedish_ci  --with-extra-charsets=all  --with-pthread  --enable-static  --enable-thread-safe-client  --with-client-ldflags=-all-static  --with-mysqld-ldflags=-all-static  --enable-assembler  --without-innodb  --without-ndb-debug
make
make install
# useradd mysql //æ·»å mysql ç¨æ·
# cd /usr/local/mysql
# bin/mysql_install_db --user=mysql
# chown -R root:mysql . //设置æéï¼æ³¨æåé¢æä¸ä¸ª "."
# chown -R mysql /var/lib/mysql //设置 mysql ç®å½æé
# chgrp -R mysql . //注æåé¢æä¸ä¸ª "."
# cp share/mysql/my-huge.cnf /etc/my.cnf
åå§å表
# /usr/local/mysql/scrīpts/mysql_install_db --user=mysql&
å¯å¨mysqlæå¡
# /usr/local/mysql/bin/mysqld_safe --user=mysql&
å¦åºç° Starting mysqld daemon with databases from /usr/local/mysql/data
代表æ£å¸¸å¯å¨mysqlæå¡äº
äºãå®è£ apache2
解å缩apacheå®è£ å ï¼è¿å ¥apacheæ件夹ã
å®è£ ï¼
apache2.2.9
 ./configure --prefix=/usr/local/apache2 --enable-http --enable-modules=all --enable-rewrite --enable-so --enable-cgi --enable-cgid --enable-deflate=shared --enable-cache --enable-file-cache
make
make install
注解ï¼
./configure //é ç½®æºä»£ç æ
--prefix=/usr/local/apache2 //ä½ç³»æ å ³æ件ç顶级å®è£ ç®å½PREFIX ï¼ä¹å°±Apacheçå®è£ ç®å½ã
--enable-module=so //æå¼ so 模åï¼so 模åæ¯ç¨æ¥æ DSO æ¯æç apache æ ¸å¿æ¨¡å
--enable-deflate=shared //æ¯æç½é¡µå缩
--enable-expires=shared //æ¯æ HTTP æ§å¶
--enable-rewrite=shared //æ¯æ URL éå
--enable-cache  //æ¯æç¼å
--enable-file-cache  //æ¯ææ件ç¼å
--enable-mem-cache  //æ¯æè®°å¿ç¼å
--enable-disk-cache  //æ¯æç£çç¼å
--enable-static-support //æ¯æéæè¿æ¥(é»è®¤ä¸ºå¨æè¿æ¥)
--enable-static-htpasswd //使ç¨éæè¿æ¥ç¼è¯ htpasswd - 管çç¨äºåºæ¬è®¤è¯çç¨æ·æ件
--enable-static-htdigest //使ç¨éæè¿æ¥ç¼è¯ htdigest - 管çç¨äºæè¦è®¤è¯çç¨æ·æ件
--enable-static-rotatelogs //使ç¨éæè¿æ¥ç¼è¯ rotatelogs - æ»å¨ Apache æ¥å¿ç管éæ¥å¿ç¨åº
--enable-static-logresolve //使ç¨éæè¿æ¥ç¼è¯ logresolve - 解æ Apache æ¥å¿ä¸çIPå°å为主æºå
--enable-static-htdbm //使ç¨éæè¿æ¥ç¼è¯ htdbm - æä½ DBM å¯ç æ°æ®åº
--enable-static-ab //使ç¨éæè¿æ¥ç¼è¯ ab - Apache HTTP æå¡å¨æ§è½æµè¯å·¥å ·
--enable-static-checkgid //使ç¨éæè¿æ¥ç¼è¯ checkgid
--disable-cgid //ç¦æ¢ç¨ä¸ä¸ªå¤é¨ CGI å®æ¤è¿ç¨æ§è¡CGIèæ¬
--disable-cgi //ç¦æ¢ç¼è¯ CGI çæ¬ç PHP
--disable-userdir //ç¦æ¢ç¨æ·ä»èªå·±ç主ç®å½ä¸æä¾é¡µé¢
--with-mpm=worker // 让apache以workeræ¹å¼è¿è¡
--enable-authn-dbm=shared // 对å¨ææ°æ®åºè¿è¡æä½ãRewriteæ¶éè¦ã
ä¸ãå®è£ php5
解å缩phpå®è£ å ï¼è¿å ¥phpæ件夹ã
å®è£ ï¼
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-zlib-dir --with-libxml-dir=/usr/local/libxml2/ --with-gd=/usr/local/gd --with-freetype-dir=/usr/local/freetype/ --with-jpeg-dir=/usr/local/jpeg/ --with-png-dir=/usr/local/png/ --enable-mbstring --with-mysql=/usr/local/mysql/ --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-gd-native-ttf --with-gettext=/usr/local/gettext/ --enable-magic-quotes --enable-sockets
make
make install
make clean
cp php.ini-dist /usr/local/php/lib/php.ini
åãæ¶å°¾å·¥ä½
vi /usr/local/apache/conf/httpd.conf
使apacheæ¯æphpï¼å¢å
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php
ä¿®æ¹DirectoryIndex index.html index.php
æ¾å°è¿ä¸æ®µï¼
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride none
æ´æ¹ä¸ºAllowOverride all
å 许apache rewrite
éå¯apacheï¼/usr/local/apache2/bin/httpd -k restart
xml/libxml/zlib/gd/png/freetype/jpeg/
å¨ç¼è¯gdçæ¶åpngæ¥éï¼
gd_png.c:791: syntax error before "for"
gd_png.c:793: warning: parameter names (without types) in function declaration
gd_png.c:793: warning: data definition has no type or storage class
gd_png.c:794: syntax error before '}' token
gd_png.c:798: warning: parameter names (without types) in function declaration
gd_png.c:798: warning: data definition has no type or storage class
gd_png.c:799: syntax error before '}' token
gd_png.c:802: syntax error before '&' token
gd_png.c:802: warning: data definition has no type or storage class
gd_png.c:404: storage size of `open' isn't known
[color=Red]make[2]: *** [gd_png.lo] Error 1
make[2]: Leaving directory `/tmp/gd-2.0.26gif'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/gd-2.0.26gif'
make: *** [all] Error 2
[[email protected] gd-2.0.26gif]# [/color]
解決æ¹æ³ä¸ºï¼
vi gd_png.c
æ¾å°ãpng.hãæ¹æã/usr/local/libpng2/include/png.hã)
*******************************************************************************************************************
å¨äº¤åç¼è¯çjpegæ¶åå¦æåºç°ä»¥ä¸çé误信æ¯ï¼
./libtool --mode=compile arm_920t_le-gcc -O2Â -I. -c ./jcapimin.c
make: ./libtool: Command not found
解å³æ¹æ³ï¼
#wget:http://ftp.gnu.org/gnu/libtool/libtool-2.2.6a.tar.gz
#./configure
#make
#make install
#cd jpeg
#cp /usr/share/libtool/config.sub .
#cp /usr/share/libtool/config.guess .
åèå°åï¼http://www.trylife.cn/error-jpeg/
å¨ç¼è¯phpçæ¶åä¼æï¼
CC=/usr/local/920t_le/bin/arm_920t_le-gcc ./configure --prefix=/usr/local/php/test --host=arm-linux --with-zlib-dir  --with-libxml-dir=/usr/local/libxml/ --with-gd=/usr/local/php/ --with-freetype-dir=/usr/local/php/ --with-jpeg-dir=/usr/local/php/ --with-png-dir=/usr/local/php/ --enable-mbstring --with-gettext=/usr/local/php/ --enable-sockets
Â
Â
Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... /usr/local/libxml/
checking for xml2-config path... /usr/local/libxml//bin/xml2-config
checking whether libxml build works...
checking for OpenSSL support... no
checking for Kerberos support... no
checking for PCRE support... yes
checking for ZLIB support... no
checking if the location of ZLIB install directory is defined... yes
checking for gzgets in -lz... no
configure: error: ZLIB extension requires zlib >= 1.0.9
cat config.log
/usr/local/libxml/lib conftest.c -lz -lm -lxml2 -lz -lm 1>&5
/usr/local/920t_le/bin/../lib/gcc/arm-linux/3.4.4/../../../../arm-linux/bin/ld:Â Â Â Â Â Â Â Â Â Â skipping incompatible /usr/local/php/lib//libxml2.so when searching for -lxml2
/usr/local/920t_le/bin/../lib/gcc/arm-linux/3.4.4/../../../../arm-linux/bin/ld:Â Â Â Â Â Â Â Â Â Â skipping incompatible /usr/local/php/lib//libxml2.a when searching for -lxml2
/usr/local/920t_le/bin/../lib/gcc/arm-linux/3.4.4/../../../../arm-linux/bin/ld:Â Â Â Â Â Â Â Â Â Â skipping incompatible /usr/local/libxml/lib/libxml2.so when searching for -lxml2
/usr/local/920t_le/bin/../lib/gcc/arm-linux/3.4.4/../../../../arm-linux/bin/ld:Â Â Â Â Â Â Â Â Â Â skipping incompatible /usr/local/libxml/lib/libxml2.a when searching for -lxml2
/usr/local/920t_le/bin/../lib/gcc/arm-linux/3.4.4/../../../../arm-linux/bin/ld:Â Â Â Â Â Â Â Â Â Â cannot find -lxml2
collect2: ld returned 1 exit status
configure: failed program was:
#line 23196 "configure"
#include "confdefs.h"
char gzgets();
int main() {
gzgets()
; return 0; }
Â
解å³åæ³ï¼éæ°å®è£ ä¸élibxmlï¼å®è£ çæ¶åï¼å¨æå®Cç¼è¯å¨çåæ¶ï¼export PATH 交åç¼è¯çç¼è¯å¨è·¯å¾
类似 ï¼export PATH="/usr/local/920t_le/armlinux/bin/:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/920t_le/bin"
ç¶åå¨configure
Â
é®é¢ï¼httpd: Syntax error on line 53 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/modules/libphp5.so into server: /usr/local/apache/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied
解å³åæ³ï¼
åå æ¯Linuxæä¸ä¸ªSELinuxä¿æ¤æ¨¡å¼å¼èµ·çã
1.å ³éSELINUXçæ¹æ³:
vi /etc linux/config å°SELINUX=enforcing æ¹æSELINUX=disabled éè¦éå¯
2.ä¸å ³éSELINUXçæ¹æ³:
# setenforce 0
# chcon -c -v -R -u system_u -r object_r -t textrel_shlib_t /usr/local/apache/modules/libphp5.so
# service httpd restart
# setenforce 1
æè
æå·¥ç¼è¯å®è£ phpåï¼å¦æä¸å顺å©è§£å³äºçè¯ï¼éå¯apacheæ¶ï¼libphp5.so: cannot restore segment prot after reloc: Permission denied é误ï¼å¦æä½ æ¯å¼çseliunx çè¯ï¼è¿è¡ä¸é¢çå½ä»¤ï¼ chcon -t texrel_shlib_t /usr/local/apache/modules/libphp5.so <å ·ä½chcon çå½ä»¤çææï¼å¯ä»¥èªå·±manä¸ä¸ï¼å®æ¯selinuxæå ³çå½ä»¤ï¼æ´æ¹æ件çæ ç¾ãlså½ä»¤å¨å½ä»¤åå 个 ï¼Z æè å âcontext æ¥çæ ç¾> å¦æ 没æå¼selinux çè¯ï¼æ¾å°libphp5.soï¼ç¶åchmod 777 libphp5.so æºèªï¼http://www.phpfreaks.com/forums/index.php?topic=133131.0;wap2
Cannot load /www/modules/libphp5.so into server error
(1/1)
bigb89 : Hi, I am trying to install PHP and configure it to work with Apache. So far I have Apache 2 and MySQL 5 working just fine, but after intalling PHP I tried to restart Apache and I get the following error: Cannot load /www/modules/libphp5.so into server: /www/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied. What's causing this error is the following line on my httpd.conf file: LoadModule php5_module       modules/libphp5.so. Could anyone explain to me what's causing this error and how can I fix it? Thanks in advance!
rlee923 : Hi, I assume you are using one of those linux with Selinux enabled. The problem is caused by the security system - selinux, blocking it's access to libph5.so. chcon -t texrel_shlib_t /usr/local/apache/modules/libphp5.so This is the magic line of the code, change the path so it points to the directory where you've installed apache2 if necessary.
Â
æ¬ææ¥èªï¼http://blog.csdn.net/do2jiang/archive/2009/12/02/4923266.aspx