没想到php的安装出了问题
    原因在于安装时mysql的支持有问题,因为mysql不 是源码安装的,所以其存放的目录比较多,有些乱

  1、数据库目录
  /var/lib/mysql/  我的已经改为 /home/data下了
  2、配置文件
  /usr/share/mysql(mysql.server命令及配置文件)
  3、相关命令
  /usr/bin(mysqladmin mysqldump等命令)

所以 --with mysql=/usr 不对
--with-mysql=/usr/share/mysql  --with-mysqli=/usr/bin/mysql_config   也不行
 难道必须也用源码重新安装一遍mysql吗? 再继续找找资料,不行就只能重新源码安装Mysql了。
 
经过不懈努力终于解决了
# ./configure  --prefix=/opt/php --with-mysql --with-mysqli  --with-apxs2=/opt/apache2/bin/apxs
出现的问题有两个:
1.
Configure: error: Cannot find MySQL header files under /usr.
Note that tySQL client librhe Mary is not bundled anymore!
解决方法:
  # yum install -y mysql-devel
2.之后又出
configure: error: Cannot find libmysqlclient under /usr.


经查,问题是64位系统中 libmysqlclient 默认安装到了 /usr/lib64/mysql 目录下
而/usr/lib 目录下没有相应文件,但是php编译时,要去 /usr/lib目录下查找,明白原因,解决办法也就相对简单了
  # cd /usr/lib(先建立mysql文件夹)
  # mkdir  mysql
#ln -s /usr/lib64/mysql/libmysqlclient.* /usr/lib/mysql
即进行符号链接
完成之后
# ./configure  --prefix=/opt/php --with-mysql --with-mysqli  --with-apxs2=/opt/apache2/bin/apxs

+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.
#make
  
   Build complete.
   Don't forget to run 'make test'.(test 很长呀)
#make install
 
   make: 警告:检测到时钟错误。您的创建可能是不完整的。
以前时间设置提前一天,刚才改正确,可能因为apache中午安装是19号,现在成18号出现的问题吧。故直接删除/opt/php重新安装。
这次配置少写 --with mysqli 也正确

Installing PEAR environment:      /opt/php/lib/php/
[PEAR] Archive_Tar    - installed: 1.3.3
[PEAR] Console_Getopt - installed: 1.2.3
[PEAR] Structures_Graph- installed: 1.0.2
[PEAR] XML_Util       - installed: 1.2.1
[PEAR] PEAR           - installed: 1.9.0
Wrote PEAR system config file at: /opt/php/etc/pear.conf
You may want to add: /opt/php/lib/php to your php.ini include_path
Installing PDO headers:          /opt/php/include/php/ext/pdo/
参考INSTALL里接着有
Setup your php.ini

  cp php.ini-dist /usr/local/lib/php.ini
  接着在httpd.conf中看是否有:
     LoadModule php5_module modules/libphp5.so
和添加
     AddType application/x-httpd-php .php .phtml
完成后启动apache
make test后出现的问题:
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :   56
Exts tested     :   23
---------------------------------------------------------------------

Number of tests : 8889              6106
Tests skipped   : 2783 ( 31.3%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :    6 (  0.1%) (  0.1%)
Expected fail   :    3 (  0.0%) (  0.0%)
Tests passed    : 6097 ( 68.6%) ( 99.9%)
---------------------------------------------------------------------
Time taken      :  496 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Bug #45877 (Array key '2147483647' left as string) [Zend/tests/bug45877.phpt]
Test DateTime::modify() function : usage variation - Passing unexpected values to first argument $modify. [ext/date/tests/DateTime_modify_variation1.phpt]
Test date_modify() function : usage variation - Passing unexpected values to second argument $format. [ext/date/tests/date_modify_variation2.phpt]
DOMDocument::$validateOnParse - effectual determination (dom_document_validate_on_parse_read/dom_document_validate_on_parse_write) [ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt]
Integer overflow [ext/filter/tests/046.phpt]
Bug #32001 (xml_parse*() goes into infinite loop when autodetection in effect), using UTF-* [ext/xml/tests/bug32001.phpt]
=====================================================================

=====================================================================
EXPECTED FAILED TEST SUMMARY
---------------------------------------------------------------------
output buffering - fatalism [tests/output/ob_011.phpt]
ob_start(): Ensure unerasable buffer cannot be flushed by ob_flush() [tests/output/ob_start_basic_unerasable_005.phpt]
SPL: ArrayObject::exchangeArray() basic usage with object as underlying data store. [ext/spl/tests/arrayObject_exchangeArray_basic3.phpt]
=====================================================================

You may have found a problem in PHP.
We would like to send this report automatically to the
PHP QA team, to give us a better understanding of how
the test cases are doing. If you don't want to send it
immediately, you can choose "s" to save the report to
a file that you can send us later.

=====================================================================