不碰PHP已经有5年多的时间了,本次出差客户要求要在非windows环境下搭建论坛,没办法只好自己动手通过网络的资源开工,但是在整个搭建过程中还是出现了不少阻力。
首先客户的环境为solaris10 Spark,决定就用 Apache + PHP + Mysql 这个组合进行。
1、Apache的安装 ,在Apache官网上找到安装包,httpd-2.0.63.tar.gz
操作步骤跟网上的都一样
gunzip httpd-2.0.63.tar.gz
tar -xvf httpd-2.0.63.tar
./configure -–prefix=/data1/Apache –enable-module=so –enable-rule=SHARED_CORE
make
make test
make install
ok,安装成功。
2、php安装, ,下载到php-5.2.11.tar.gz
gunzip php-5.2.11.tar.gz
tar -xvf php-5.2.11.tar
./configure --prefix=/usr/local/php5 --with-apxs2=/data1/Apache/bin/apxs --with-mysql=/opt/mysql/mysql --with-zlib-dir=/usr/local
当敲完该命令时,发现有些不对头,configure时需要Mysql
记得安装Solaris时有Mysql,决定使用其自带的
使用root身份进入,执行:
bash-3.00#/usr/sfw/sbin/mysql_install_db
Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables
091111 18:11:49 /usr/sfw/sbin/mysqld: Shutdown Complete
/usr/sfw/bin/mysqld_safe &
启动后经测试正常。
然后对php进行configure ,但configure 过程中出错
configure: error: mysql configure failed. Please check config.log for more information.检查日志config.log后发现在libmysqlclient.so
通过多方努力,找到一个对自己有帮助的信息
注:安装 mysql5devel 软件包非常重要,否则在稍后生成 PHP 5 时会遇到问题。
难道Solaris上当初装的有问题?