簡體   English   中英

XAMPP:如何為PHP配置Apache

[英]XAMPP: how to configure Apache for PHP

我的XAMPP沒有讀我的PHP。 可能是我的Apache配置存在問題。 我的PHP書建議我打開httpd配置文件並添加以下行:

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

我做了哪些,但當我回到控制面板重新打開Apache時,我無法通過它獲得正在運行的標志。 我認為這是因為我的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.  

如果您使用的是從他們的網站下載的XAMPP,那么PHP應該可以直接使用。 您始終可以嘗試從source forge再次下載。 您始終可以在錯誤日志中查找錯誤。

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

確保默認情況下Apache使用的端口80不被其他應用程序(如Skype等)使用。

正如colum所說,xammp應該開箱即用,php已經正常工作。

創建一個像這樣的測試php頁面並將其放在htdocs文件夾中

<?php
echo "PHP works";
?>

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM