1,安装libxml2库:
安装三步骤
可能出现的问题:
make[2]: *** [nanohttp.lo] 错误 1
make[2]:正在离开目录 `/usr/local/src/libxml2-2.6.30'
make[1]: *** [all-recursive] 错误 1
make[1]:正在离开目录 `/usr/local/src/libxml2-2.6.30'
make: *** [all] 错误 2usage: sudo -h | -K | -k | -L | -Vr
解决办法为:
打开libxml2目录下的nanohttp.c,第1588行由
fd = open(filename, O_CREAT | O_WRONLY);更换为
fd = open(filename, O_CREAT | O_WRONLY,0777);
然后在输入make install
2.安装libmcrypt
checking for C++ compiler default output file name... configure: error: C++ compiler cannot create executables
See `config.log' for more details.
解决:安装g++
3 安装zlib库
4安装libpng
5安装jpeg6
6安装freetype
7安装autoconf
问题:
configure: error: GNU M4 1.4 is required
解决:
http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz
下载安装
注:不需要指定安装目录
8 安装GD库
./configure \
>--prefix=/usr/local/gd2 //指定软件安装位置
>--with-zlib= //设为zlib库文件的安装位置
>--with-jpeg= //设为jpeg的安装位置
>--with-png= //设为png库的安装位置
>--with-freetype //设为freetype的安装位置
9安装apache(终于到了)
./configure \
>--prefix=/usr/local/apache2 //指定apache的安装目录
>--sysconfdir=/etc/httpd //指定服务器的配置文件的存放位置
>--with-z= //zlib库的位置
>--with-included-apr //使用捆绑APR/APR-Util的副本
>--enable-so //以动态共享对象(DSO)编译
>--enable-deflate=shared //缩小传输编码的支持
>--enable-expires=shared //期满头控制
>--enable-rewrite=shared //基于规则的URL 操控
>--enable-static-support //建立一个静态链接版本的支持
问题:
libtool: link: cannot find the library `server/libmain.la' or unhandled argument `server/libmain.la'
解决:
执行一次make clean
可能是遗留的文件的干扰
测试:
netstat -ntl 观测80端口
如果运行apachectl start 出现httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
则修改/etc/httpd/httpd.conf 添加ServerName localhost:80 保存
10 mysql安装
建立mysql的管理用户组和用户名 如:mysql:mysql
问题:
configure: error: No curses/termcap library found
解决:
apt-get install libncurses5-dev
缺少包,这或许就是linux的缺点吧,有些安装也看不从来缺少库,当然是对于我这新手党,不过随着checking 心也在跳,新手党啊
这或许也是他的有点吧!!!玩linux就是玩心跳啊
开启mysql :
安装目录/bin/mysqld_safe --user=mysql &
之后运行netstat -ntl 查看3306端口是否开启
11安装php
./configure --prefix=/home/php/development_environment/php5
-- with-config-file-path=/home/php/development_environment/php5/etc
--with-apxs2=/home/php/apache2/bin/apxs
--with-mysql=/home/php/development_environment/10_mysql
--with-libxml-dir=/home/php/development_environment/1_libxml2
--with-png-dir=/home/php/development_environment/4_libpng
--with-jpeg-dir=/home/php/development_environment/5_jpeg6
--with-freetyle-dir=/home/php/development_environment/6_freetype
--with-gd=/home/php/development_environment/8_gd2
--with-zlib-dir=/home/php/development_environment/3_zlib
--with-mcrypt=/home/php/development_environment/2_libmcrypt
--with-mysqli=/home/php/development_environment/10_mysql/bin/mysql_config //变量激活新增加的Mysql功能
--enable-soap //变量激活SOAP和web service 支持
--enable-mbstring=all //使多字节字符串支持
--enable-sockets //变量激活socket通讯特性
问题:
configure: error: Unable to find gd.h anywhere under /home/php/development_environment/8_gd2
重装gd2
又可能的问题:gd_png.c:16:53: fatal error: png.h: No such file or directory
解决:vim gd_png.c
将
#include “png.h”
替换成:
#include “/usr/local/libpng/include/png.h”
然后再make就可以了
又有问题: /home/php/development_environment/1_libxml2/lib/libxml2.so: undefined reference to `gzopen64@ZLIB_1.2.3.3'
collect2: ld returned 1 exit status