php的安装

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

  一、数据库目录
  /var/lib/mysql/  个人已经改成 /home/data下了
  二、配置文件
  /usr/share/mysql(mysql.server命令及配置文件)
  三、相关命令
  /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. =====================================================================
相关文章
相关标签/搜索