Freebsd7.0+Apache2.2+MySQL5+PHP5( 二 )


726 v4 Is 0:00.00 /usr/libexec/getty Pc ttyv4
727 v5 Is 0:00.00 /usr/libexec/getty Pc ttyv5
728 v6 Is 0:00.00 /usr/libexec/getty Pc ttyv6
729 v7 Is 0:00.00 /usr/libexec/getty Pc ttyv7
7022 p0 S 0:00.01 /bin/sh /usr/local/mysql/bin/mysqld_safe --user=mysql
7038 p0 R 0:00.00 ps -ef
上述信息表明MySQL安装成功
为了每次系统重启后都能运行mysql,可以写一个脚本放到 /etc/rc.d目录下,用来运行mysql,我们写一个脚本mysql_start.sh
#! /bin/sh
/usr/local/mysql/bin/mysqld_safe&
然后保存到/etc/rc.d目录下,那么以后reboot系统后都能启动mysql了.
MySQL的安装是最顺利的一个
三、安装PHP
去http://www.php.net网站上去下载php-5.2.5的源码包
解压缩
#tar zxvf php-5.2.5.tar.gz
#cd php-5.2.5
配置
# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql
出现如下错误提示:
Sorry, I cannot run apxs. Possible reasons follow:
1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)
The output of /usr/local/apache/bin/apxs follows:
./configure: /usr/local/apache/bin/apxs: not found
configure: error: Aborting
表明没有安装perl
下载perl进行安装(去http://www.perl.com下载最新版本,我从别的网站下载了个5.8版本make时死活过不去)
#tar xzvf perl-5.10.0.tar.gz
#sh Configure -de
#make
#make test
#make install
安装完perl后还是提示上述错误,
我就去apche的源程序中又来了一次下面的动作
配置
#./configure --prefix=/usr/local/apache --enable-so --enable-module=rewrite
编译
#make
安装
#make install
后重新configure php时出现如下错误:
configure: error: xml2-config not found. Please check your libxml2 installation.
安装libxml2
#tar zxvf libxml2-2.6.31.tar.gz
#cd libxm2-2.6.31
#./configure
#make
#make install
安装libxml2后,重新configure php 出现如个错误提示:
configure: error: Please specify the install prefix of iconv with --with-iconv=


#tar zxvf libiconv-1.10.tar.gz
#cd libiconv-1.10
#./configure
#make
#make install
注意:我开始的时候安装的 libiconv-1.11结果安装完成后,重起启动时出现问题(用户就是登录不去,不是是系统的bug还是软件的兼容性不好,后来用单用户进入,删除了/usr/local/下的libiconv相关文件才得以登录系统,从出现这个问题到解决这个问题花了我半天的时间,大家一定要记住这个教训)
安装完libxml2后重新configure php
这样再configure php时结果还提示错误,具体的信息忘记记下来了,大体的意思是说没有找到iconv和libiconv请reinstall iconv,这时候已经是晚上10点多了,我怒了,决定试一下ports安装iconv和libiconv.(这下子我是实在没有耐心了)
#whereis iconv
根据提示到相应的目录下iconvpath指相应的目录(当时系统提示的信息具体是什么我记不清了)
#cd iconvpath
然后开始安装
#make install clean
执行上述命令时出/usr/ports/distfiles下没有找到文件,然后出现一个连接到ftp下载的信息,没办法我这个机器不能上外面,我只能用另一台机器上那个ftp上下载软件然后再放到/usr/ports/distfiles这里,重新make install clean 结果又提示缺少什么软件,我就这样一个一个的下载下来放到/usr/ports/distfiles里面
按照上述的方式又安装了libiconv
本已经编译安装了perl 后来一想反正是要ports,就再ports一下这个perl吧
就这样又ports安装了perl一次.

推荐阅读