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. =====================================================================
相關文章
相關標籤/搜索