2010-10-15 86 views
1

我的XAMPP沒有閱讀我的PHP。可能,我的Apache配置存在問題。我的PHP書建議我打開httpd配置文件,並添加這些行:XAMPP:如何爲PHP配置Apache

LoadModule php5_module c:/php/php5apache2_2.dll 
PHPIniDir "c:/php/" 
AddType application/x-httpd-php .php 

,我做到了,但是當我回到了控制面板打開阿帕奇回來,我不能讓正在運行的標誌通過它。我想這是因爲我的PHP不認爲我在使用XAMPP。我試着不要使用以下:

LoadModule php5_module c:/xampp/php/php5apache2_2.dll 
PHPIniDir "c:/xampp/php/" 
AddType application/x-httpd-php .php 

但問題沒有得到解決(PHP仍不能正常工作,我不能被Apache在控制面板中取得運行的標誌)。我該怎麼辦?如果它很重要,我正在使用Windows 7。

卸載XAMPP並刪除目錄後,我遇到了同樣的問題。下面是最新的錯誤日誌:

[Fri Oct 15 19:44:00 2010] [notice] Digest: generating secret for digest authentication ... 
[Fri Oct 15 19:44:00 2010] [notice] Digest: done 
[Fri Oct 15 19:44:00 2010] [notice] Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations 
[Fri Oct 15 19:44:00 2010] [notice] Server built: Nov 11 2009 14:29:03 
[Fri Oct 15 19:44:00 2010] [notice] Parent: Created child process 912 
[Fri Oct 15 19:44:03 2010] [notice] Digest: generating secret for digest authentication ... 
[Fri Oct 15 19:44:03 2010] [notice] Digest: done 
[Fri Oct 15 19:44:04 2010] [notice] Child 912: Child process is running 
[Fri Oct 15 19:44:04 2010] [notice] Child 912: Acquired the start mutex. 
[Fri Oct 15 19:44:04 2010] [notice] Child 912: Starting 150 worker threads. 
[Fri Oct 15 19:44:04 2010] [notice] Child 912: Starting thread to listen on port 443. 
[Fri Oct 15 19:44:04 2010] [notice] Child 912: Starting thread to listen on port 80. 
+0

PHP書不認爲我使用XAMPP,我應該說。 – user460847 2010-10-15 22:17:19

+1

屬於serverfault。 – 2010-10-15 22:19:28

+0

不是Windows上的目錄分隔符'\'?你爲什麼使用斜槓,你習慣於Linux?如果是的話,爲什麼不把你的服務器安裝在VirtualBox上的debian上? – greg0ire 2010-10-15 22:21:35

回答

3

如果使用的是XAMPP,你從他們的網站上下載,PHP應該是正確的工作開箱。您始終可以嘗試從源僞造再次下載它。您始終可以查看錯誤日誌中的錯誤。

0

確保您沒有運行XAMPP或任何其他服務器的其他副本,這可能會導致衝突。

使這是Apache使用默認端口確保80不被其他應用程序如Skype等

正如科拉姆說,XAMMP應開箱和PHP已經工作的。

創建這樣一個測試的PHP頁面,並把它放在htdocs文件夾

<?php 
echo "PHP works"; 
?> 

如果你可以進入管理頁面,有一個環節php.info。看看它是否有效。