PHP編譯問題匯總

來源:互聯網
上載者:User
1、PDO_MYSQL make: *** [pdo_mysql.lo] Error 1

編譯安裝PDO_MYSQL拓展模組,總是提示:

In file included from/data0/software/PDO_MYSQL-1.0.2/pdo_mysql.c:31:

/data0/software/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:25:19:error: mysql.h: No such file or directory

In file included from/data0/software/PDO_MYSQL-1.0.2/pdo_mysql.c:31:

/data0/software/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:36:error: expected specifier-qualifier-list before ‘MYSQL’

/data0/software/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:48:error: expected specifier-qualifier-list before ‘MYSQL_FIELD’

/data0/software/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:53:error: expected specifier-qualifier-list before ‘MYSQL_RES’

make: *** [pdo_mysql.lo] Error 1

這是因為這是因為在編譯時間需要 MySQL 的頭的檔案。而它按預設搜尋找不到標頭檔的位置,所以才出現這個問題。通過軟串連把MySQL標頭檔對應到/usr/local/include/下就好

比如你的MySQL安裝檔案位於/usr/local/mysql,那麼就執行以下命令:

# ln -s /usr/local/mysql/include/* /usr/local/include/

在PHP設定檔php.ini中添加擴充時要使用絕對路徑

extension="/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/pdo_mysql.so"

2、在搭建phpadmin的時候系統session_start()錯誤

錯誤資訊:

Warning: session_start():open(/var/lib/php/session/sess_qavhhacl7lrdbggauasf1qdlo5, O_RDWR) failed: Nosuch file or directory (2) in /www/tool/classes/service/User.php on line75
Warning: Unknown: open(/var/lib/php/session/sess_qavhhacl7lrdbggauasf1qdlo5,O_RDWR) failed: No such file or directory (2) in Unknown on line 0
Warning: Unknown: Failed to write session data (files). Please verify that thecurrent setting of session.save_path is correct (/var/lib/php/session) inUnknown on line 0

查看php.ini:

session.save_path = "/var/lib/php/session" //session的存放路徑

所以上面的文字是提示沒有該目錄

解決問題:

建立上面的目錄

mkdir session

chmod -R 777 session

再次運行程式就OK了

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.