2011-04-10 302 views
0

我正在使用Apserve包開發包含PHP5和Codeigniter的開發環境。我想升級到PHP 5.3,所以我下載了ZIP文件並將其解壓到c:\apserve\php5目錄中。在這之後,事情變得非常瘋狂和混亂。PHP不能正常工作

儘管apache正在工作,但PHP根本沒有工作。唯一的頁面工作是http://localhost/,而phpmyadmin http://localhost/phpmyadminhttp://localhost/ci文件夾根本不加載。當我嘗試在本地訪問phpmyadmin時,該鏈接顯示在瀏覽器的鏈接欄中。

所以我如何重新配置​​PHP來讓它工作?

筆記:

  • php.ini文件位於Windows文件夾和文件夾c:\apserve\php6
  • php文件夾有兩個位置; c:\programfiles\php6c:\apserve\php6

我只想使用c:\​​ apserve內容。

這是刪除以前的錯誤和清理啓動後的錯誤日誌。

[Sun Apr 10 17:48:06 2011] [warn] Init: Session Cache is not configured [hint: SSLSessionCache] 
PHP Warning: Directive 'register_globals' is no longer supported in PHP 6 and greater in Unknown on line 0 
PHP Warning: Directive 'register_long_arrays' is no longer supported in PHP 6 and greater in Unknown on line 0 
PHP Warning: Directive 'magic_quotes_gpc' is no longer supported in PHP 6 and greater in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_curl.dll' - The specified module could not be found.\r\n in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_exif.dll' - The specified module could not be found.\r\n in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_gd2.dll' - The specified module could not be found.\r\n in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_mbstring.dll' - The specified module could not be found.\r\n in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_mysql.dll' - The specified module could not be found.\r\n in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_mysqli.dll' - The specified module could not be found.\r\n in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_openssl.dll' - The specified module could not be found.\r\n in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_pdo.dll' - The specified module could not be found.\r\n in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_pdo_sqlite.dll' - The specified module could not be found.\r\n in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_sockets.dll' - The specified module could not be found.\r\n in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_sqlite.dll' - The specified module could not be found.\r\n in Unknown on line 0 
[Sun Apr 10 17:48:07 2011] [notice] Apache/2.2.8 (Win32) mod_ssl/2.2.8 OpenSSL/0.9.8g PHP/6.0.0-dev configured -- resuming normal operations 
[Sun Apr 10 17:48:07 2011] [notice] Server built: Jan 18 2008 00:37:19 
[Sun Apr 10 17:48:07 2011] [notice] Parent: Created child process 4872 
[Sun Apr 10 17:48:07 2011] [warn] Init: Session Cache is not configured [hint: SSLSessionCache] 
PHP Warning: Directive 'register_globals' is no longer supported in PHP 6 and greater in Unknown on line 0 
PHP Warning: Directive 'register_long_arrays' is no longer supported in PHP 6 and greater in Unknown on line 0 
PHP Warning: Directive 'magic_quotes_gpc' is no longer supported in PHP 6 and greater in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_curl.dll' - The specified module could not be found.\r\n in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_exif.dll' - The specified module could not be found.\r\n in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_gd2.dll' - The specified module could not be found.\r\n in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_mbstring.dll' - The specified module could not be found.\r\n in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_mysql.dll' - The specified module could not be found.\r\n in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_mysqli.dll' - The specified module could not be found.\r\n in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_openssl.dll' - The specified module could not be found.\r\n in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_pdo.dll' - The specified module could not be found.\r\n in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_pdo_sqlite.dll' - The specified module could not be found.\r\n in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_sockets.dll' - The specified module could not be found.\r\n in Unknown on line 0 
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/AppServ\\php5\\ext\\php_sqlite.dll' - The specified module could not be found.\r\n in Unknown on line 0 
[Sun Apr 10 17:48:07 2011] [notice] Child 4872: Child process is running 
[Sun Apr 10 17:48:07 2011] [notice] Child 4872: Acquired the start mutex. 
[Sun Apr 10 17:48:07 2011] [notice] Child 4872: Starting 64 worker threads. 
[Sun Apr 10 17:48:07 2011] [notice] Child 4872: Starting thread to listen on port 80. 

回答

1

在那個日誌輸出中有矛盾的信息,在我看來你是在php6中加載php5擴展。

你有沒有嘗試刪除所有安裝的PHP和安裝只有你需要的。

如果你真的必須有多個版本的PHP運行,你有沒有考慮虛擬化你的開發環境?

+0

是的,你是正確的,我安裝5.3後嘗試,並沒有工作嘗試php6。我認爲現在問題解決使用刪除programfiles文件夾中的其他PHP安裝並將php.ini重定位到Windows文件夾 – Khaled 2011-04-12 13:25:27

+0

,並確保完全安裝apserve! – Khaled 2011-04-12 13:26:29

1

確保您已啓用php.ini中的所有擴展(特別是MySQL)。

如果你有以前的PHP安裝(文件夾)的備份,我建議複製&覆蓋php.ini文件。

還檢查Apache error_log文件(在您的apache文件夾中),並在那裏看到錯誤,因爲apache會在啓動過程中記錄任何PHP錯誤。

+0

之前,php.ini被安裝在windows文件夾中,但不是現在。也許問題是在php.ini文件的位置?我如何更改默認鏈接到該文件? – Khaled 2011-04-10 14:30:11