源文件包合集下载地址:
csdn 
lamp源码安装包合集(上)
lamp源码安装包合集(下)
新浪爱问共享:
上:http://ishare.iask.sina.com.cn/f/35296167.html
下:http://ishare.iask.sina.com.cn/f/35296169.html

lamp源码安装包合集(上)
lamp源码安装包合集(下)

下载并解压所有软件到/usr/local/目录下

1.安装libxml2
./configure --prefix=/usr/local/libxml2
make && make install

2.安装libmcrypt
./configure --prefix=/usr/local/libmcrypt
make && make install

3.安装zlib
./configure --prefix=/usr/local/zlib
make && make install

4.安装libpng
./configure --prefix=/usr/local/libpng
《问题》:安装时提示zlib not found 
《解决方法》:在配置时加--with-zlib-prefix=/usr/local/zlib参数(也可以直接将zlib安装到默认目录,此处就不会报错了)

5.安装jpeg6
创建文件目录:
mkdir -p /usr/local/jpeg6/bin
mkdir -p /usr/local/jpeg6/lib
mkdir -p /usr/local/jpeg6/man/man1
mkdir -p /usr/local/jpeg6/include

./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
make && make install

6.安装freetype
./configure --prefix=/usr/local/freetype
make && make install

7.安装autoconf
./configure --prefix=/usr/local/autoconf
make && make install

8.安装GD库
./configure --prefix=/usr/local/gd --with-zlib=/usr/local/zlib --with-jpeg=/usr/local/jpeg6 --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype
make && make install
《问题》如果提示错误[gd_png.lo] Error 1
《解决方法》:更改gd_png.c文件(vim gd_png.c) ; 将 png.h 改为 /usr/local/libpng/include/png.h

9.安装apache
./configure --prefix=/usr/local/apache2 --sysconfdir=/usr/etc/apache2 --with-z=/usr/local/zlib
--with-include-apr --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared 
--enable-static-support
make && make install
《问题》:安装过程如果提示找不到apr,apr-util,pcre,需要安装这三个软件,并在编译配置时指定参数
--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
--with-pcre=/usr/local/pcre

测试:进入apache2目录(cd /usr/local/apache2), 启动apache(/bin/apachectl start)
开机自启:echo "/usr/local/apache2/bin/apachectl start" >> /etc/rc.d/rc.local

10.安装mysql
创建mysql用户放入mysql用户组:groupadd mysql ;useradd -g mysql mysql
./configure --prefix=/usr/local/mysql --with-extra-charsets=all --sysconfdir=/usr/etc/mysql
make && make install
拷贝配置文件:cp /usr/local/mysqlXXXX/support-files /usr/etc/mysql
生成授权表:/usr/local/mysql/bin/mysql_install_db --user=mysql 
启动数据库: /usr/local/mysql/bin/mysqld_safe --user=mysql &
登陆数据库:/usr/local/mysql/bin/mysql -u root 
《问题1》:configure: error: No curses/termcap library found 
《解决方法》:安装ncurses-5.6.tar.gz (./configure)
在mysql配置中加:--with-named-ncurses-libs=/usr/lib
《问题2》:FATAL ERROR: could not find /usr/bin/my_print_defaults创建权限表出错 
《解决方法》:进入安装目录,创建mysql权限表
使用basedir参数指出安装目录,/usr/local/mysql/bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

11.安装php(安装前关闭apache:/usr/local/apache2/bin/apachectl stop)
./configure --prefix=/usr/local/php --with-config-file-path=/usr/etc/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-libxml-dir=/usr/local/libxml2 --with-png-dir=/usr/local/libpng --with-jpeg-dir=/usr/local/jpeg6 --with-freetype-dir=/usr/local/freetype --with-gd=/usr/local/gd --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-soap --enable-mbstring=all --enable-sockets
make && make install
《问题1》:如果遇到
/usr/bin/ld: cannot find -lltdl
collect2: ld returned 1 exit status
make: *** [libphp5.la] Error 1
《解决方法》:安装libtool-2.4.2.tar.gz(./configure),重新编译

配置php:将php.ini-dush拷到/usr/etc/php目录下
在/usr/etc/apache/httpd.conf 加AddType application/x-httpd-php .php .phtml

posted on 2013-01-04 13:14  weeln  阅读(304)  评论(0编辑  收藏  举报