How To Configure PHP 5 With Apache 2 On Windows in 2 Minutes如何配置PHP 5中與Apache 2在Windows在2分鐘
I am assuming that you have downloaded and installed Apache 2.x on your windows machine.我假設您已經下載並安裝的Apache 2.x的在你的Windows機器。 Use the latest version 2.2, if you do not have plans to run Subversion on it.使用最新版本2.2 ,如果你不打算運行顛覆它。 Otherwise choose Apache 2.0.x.否則,選擇的Apache 2.0.x. Install it with the defaults.安裝它與默認值。 You may want to however changes the drive on which it is installed.您可能會想要,但變化的驅動器上安裝它。 Anyway so you have it running.無論如何,讓您有它運行。 Then you went to php.net and have downloaded and extracted the zip file to say c:\ or d:\.然後你去php.net和下載並解壓縮zip檔案說,為C : \或D : \ 。 I am assuming you have then changed the name of php.ini-recommended to php.ini.我假設你,然後改變名稱的php.ini -建議php.ini的影響。 So far all the steps are straight forward and their install guide is good enough.到目前為止,所有的步驟都直和發揚他們的安裝指南是不夠好。 Now you are feeling happy about it and want to integrate PHP with Apache, right?現在你的感覺感到高興,並想要整合的PHP與Apache ,對不對? That’s when the fun begins.這時候的樂趣開始。
To cut the long story short the instructions in PHP document doesn’t work and have obviously not been updated in a long while.削減長期的故事,短的指示,在PHP文件沒有工作,並有明顯尚未更新,在一個長期而。 So I will give you a 2 minute guide to glory.因此,我會給你2分鐘指南輝煌。
Open httpd.conf (in Drive:\Program Files\Apache Group\Apache2\conf) and search for LoadModule statements.開放的httpd.conf (在驅動器: \程序文件\阿帕奇組\ Apache2中\設置) ,並搜尋loadmodule報表。 At the end add:在去年底地址:
LoadModule php5_module "D:/php/php5apache2.dll" loadmodule php5_module的“ D : / php/php5apache2.dll ”
Then search for然後搜索
AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps 將AddType application / x -的httpd - PHP中。 PHP的將AddType application / x -的httpd - PHP的源。 phps
Note: The last AddType is a nicety.注:最後將AddType是一個準確。 It allows you to view .phps files (php files with extension renamed) in htmlized and colorful format from your browser.它可以讓您的看法。 phps文件( PHP文件的擴展名與改名)在htmlized和豐富多彩的形式,從您的瀏覽器。
Now restart the server.現在重新啟動服務器。
Did I say you are done?我說你是做什麼? Well, you are.那麼,你是。 So go out and enjoy.因此,走出去和享受。
Note: If you are a wimp and you don’t need Subversion you may take the easy way out and install Xampp instead.注意:如果你是一個wimp和您不需要顛覆你可以採取簡單的方法,並安裝xampp不是。 It will do the dirty work for you.它也將這樣做骯髒的為您工作。
Filed under提起下 Headline News頭條新聞 , , How To如何 , , Open Source Software開放源碼軟件 , , PHP PHP的 , , Tech Note技術說明 , , Web網頁 , , Web Hosting虛擬主機 , , Web Services Web服務 , , Windows在Windows | |
| |
RSS 2.0 2.0 | |
Trackback Trackback跟踪 this Article |此文章|
Email this Article電子郵件此文章
You may also like to read您也可以想讀 |





September 22nd, 2007 at 4:16 am 2007年9月22日在上午04時16分
Thank U very much..感謝u十分..
October 14th, 2007 at 11:28 pm 2007年10月14日在下午11時28分
hi嗨
does this config works on vista?這是否配置工程對Vista嗎?
i download the latest php, but font contian the php5apache2.dll but i have the php5ts, can any1 tell me what to do..please我下載最新的PHP ,但字體contian該php5apache2.dll ,但我有php5ts ,可以any1告訴我該怎麼辦..請
December 18th, 2007 at 10:50 am 2007年12月18日在上午10時50分
Awesome, thanks!可怕,謝謝! this was the critical part I needed.這是關鍵的一部分,我需要。 Even book installation procedures were off base甚至圖書的安裝程序被關閉基地
February 24th, 2008 at 9:39 pm 2008年2月24日在下午9點39分
Thanks,謝謝,
That worked well.運作良好。
Extra step to smooth things in Vista額外的步驟,以打圓場,在Vista
I would add that in the htdocs folder (for those lazy folks who don\’t change the root directory to be something else), that changing the permission ability for USER makes it really simple to add/edit files我想補充一點,在htdocs文件夾(對於那些懶惰的鄉親誰不\ ' T改變的根目錄中必須有其他) ,即改變許可的能力,為用戶作出是否真的簡單到添加/編輯檔案
go to htdocs directory到htdocs目錄
right click and select \”Customize This Folder\”點擊右鍵並選擇\ “自定義文件夾\ ”
select \”Security\” tab.選擇\ “安全\ ”標籤。
select \”Edit\” or \”Advanced\” to change the permissions for USER選擇\ “編輯\ ”或\ “先進\ ”改變權限
May 31st, 2008 at 7:17 am 2008年5月31日在上午07時17分
Hi嗨
Thanks for the info感謝信息
Short and good.短期和良好的。
Well done做得好
I have follow you instructions but I get an error:我跟隨你的指示,但我得到一個錯誤:
The specified module could not be found.指定的模組無法找到。
My OS is Vista home premium.我的操作系統是Vista家庭高級版。
Must say that the file: php5apache2.dll必須指出,該文件中: php5apache2.dll
was not part of the PHP package.是不是部分的PHP軟件包。
instead, I have: php5ts.dll相反,我有: php5ts.dll
(Here is a good link to find that missing php5apache2.dll (這裡是一個很好的鏈接,發現失踪的php5apache2.dll
http://kromann.info/download.php?strFolder=php5_1-Release_TS&strIndex=PHP5_1 http://kromann.info/download.php?strfolder=php5_1-release_ts&strindex=php5_1
) )
This is the code lines from my httpd.conf這是該守則線從我的httpd.conf
I have placed the lines at the end of the LoadModule list.我已經把線在年底的loadmodule名單。
This line is the last one on the list:這條線是最後一名單上:
#LoadModule vhost_alias_module modules/mod_vhost_alias.so # loadmodule vhost_alias_module模組/ mod_vhost_alias.so
Then right bellow I have placed the 3 lines as you instructed:然後再轉右貝婁我放在三線,正如你指示:
LoadModule php5_module “php/php5apache2.dll” loadmodule php5_module “ php/php5apache2.dll ”
AddType application/x-httpd-php .php將AddType application / x -的httpd - PHP中。 PHP的
AddType application/x-httpd-php-source .phps將AddType application / x -的httpd - PHP的源。 phps
Please advice請諮詢
Thanks for your help感謝您的幫助
Amit C.阿米特長