Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 3安裝Web服務器在Windows XP的Apache2 , php5和mysql4 -第3部分
Part 3 - Install PHP 5 第3部分-安裝P HP5
Unzip the PHP zip package that downloaded in解壓縮PHP的郵編包下載在 Part 1第1部分 to C:\PHP (Create a new folder named PHP at C:\ root level).到C : \ php (將創建一個新文件夾命名的PHP在C : \根目錄一級) 。 Then shut down Apache server.然後關機, Apache服務器。
Open the Apache httpd.conf with a text editor and add two lines of code:開放的Apache httpd.conf文件用文本編輯器並添加兩行代碼:
LoadModule php5_module C:/php/php5apache2.dll loadmodule php5_module c : / php/php5apache2.dll
AddType application/x-httpd-php .php將AddType application / x -的httpd - PHP中。 PHP的
Added .php extension to show how to parse .php files 補充說。 PHP的擴展,以顯示如何解析。 PHP文件
Note also the directory in load module points to where we installed PHP.還注意到目錄中的負載點模塊的地方,我們安裝了PHP 。 So if you install PHP at other location, change it accordingly.因此,如果你安裝PHP在其他位置,改變它。 The directory style should be / too instead of common DOS \.目錄作風,應該是/太不是共同DOS的\ 。
These two lines can be added to the bottom of the httpd.conf file.這兩條路線可以被添加到底部的httpd.conf文件。 However, note that modules in the load list are in reverse-priority order; those that come later can override or pre-empt those listed earlier.然而,請注意,模塊的負荷名單是在反向的優先次序;那些稍後可以凌駕或先發製人的那些上市較早。 Therefore, adding php_mod at the end of the list can have unexpected results, such as disabling mod_rewrite (and other modules) for any php files that exist (mod_rewrite will run fine if the file doesn’t exist).因此,加入php_mod在名單的末尾可以有意想不到的結果,如禁用mod_rewrite (和其他模塊)的任何PHP文件的存在( mod_rewrite將運轉良好,如果該文件不存在) 。 The same error can disable mod_auth and other important modules.同樣的錯誤可以禁用mod_auth和其他重要的模塊。 In summary, php_mod should be loaded before any modules you wish to run before your php code is executed.總括來說, php_mod應該被載入之前,任何模塊你想運行之前,您的PHP代碼執行。 See the note in the看到注意:在 Apache AddModule documentation阿帕奇addmodule文件 for how to find the recommended ordering.對於如何尋找建議訂購。
Next, copy/paste “php.ini-recommended” to C:/Program Files/Apache Group/Apache2 (or your Apache installation path), and rename it to php.ini.下一步,複製/粘貼“ php.ini的推薦”到C : /程序文件/阿帕奇group/apache2 (或你的Apache安裝路徑) ,將它重新命名為php.ini的影響。 Restart the Apache server.重新啟動Apache服務器。
Testing php5 Installation 測試php5安裝
Create a file with the following contents and save it to the root web folder (C:/Server/htdocs or default C:/Program Files/Apache Group/Apache2/htdocs/) as “php5info.php”.建立一個檔案,以下的內容和它保存到Web根目錄文件夾( C : /服務器/ htdocs或默認c : /程序文件/阿帕奇group/apache2/htdocs / )作為“ php5info.php ” 。
<?php < ? PHP的
phpinfo(); phpinfo ( ) ;
?> ? >
Access the following url訪問以下網址 http://localhost/php5_info.php . 。 The complete PHP setting should be displayed on the browser.完整的PHP的設置應顯示在瀏覽器中。 If there is an error or nothing been shown, there is problem with installation.如果有錯誤或沒有被證明,有問題,與安裝。 Try the installation procedures again.嘗試安裝程序。
Enable MySQL extension 使MySQL擴展
The php.ini that copied from php.ini-recommended already being set to optimum setting, so there is no special need to edit it.在php.ini認為,從複製的php.ini -建議已被設定為最佳設置,所以沒有特別需要,編輯它。 However, it still need to edit to enable mysql extension.然而,它仍然需要修改,使MySQL擴展。
Open php.ini in the Apache2 directory with text editor.開放的php.ini ,在目錄中的Apache2與文本編輯器。
Search for the line of extension_dir = “./” .搜索該行extension_dir = “ 。 / ” 。 Change it to extension_dir = “C:\php5\ext” .將它更改為extension_dir = “為C : \ php5 \分機” 。 Also, uncomment the line of extension=php_mysql.dll .此外,取消對線的延長= php_mysql.dll 。
Save the php.ini.保存php.ini的影響。 Restart the Apache server.重新啟動Apache服務器。 Re-try to access重新嘗試訪問 http://localhost/php5_info.php . 。 It should working fine.它應工作的罰款。 If not try to check what’s the cause of errors, which most likely due to wrong extension_dir or missing extension.如果沒有嘗試檢查什麼樣的事業的錯誤,其中最有可能是由於錯誤的extension_dir或失踪的延伸。 Or you may try to copy all the needed extentions (with .dll extenstion) to Apache2 directory.或您可能會嘗試複製所有必要的擴張(與的。 dll extenstion )的Apache2目錄。
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要說明 :這是一個機器翻譯網頁是“按原樣”提供的擔保。 Machine translation may be difficult to understand.機器翻譯可能很難理解。 Please refer to請參閱 original English article英文原版的文章 whenever possible.只要有可能。
Share and contribute or get technical support and help at分享和貢獻,或取得技術的支持和幫助,在 My Digital Life Forums 我的數字生活論壇 . 。
Related Articles相關文章
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 1安裝Web服務器在Windows XP的Apache2 , php5和mysql4 -第1部分
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 4安裝Web服務器在Windows XP的Apache2 , php5和mysql4 -第4部分
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 2安裝Web服務器在Windows XP的Apache2 , php5和mysql4 -第2部分
- Using phpMyAdmin for Effective MySQL Management in Windows XP使用phpmyadmin有效MySQL的管理在Windows XP
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 5安裝Web服務器在FreeBSD的6.0與2.2的Apache , MySQL 5.0的和PHP 5 -第5部分
- Install, Setup and Configure CGI and Perl in Windows XP安裝,安裝和配置的CGI和Perl在Windows XP
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 4安裝Web服務器在FreeBSD的6.0與2.2的Apache , MySQL 5.0的和PHP 5 -第4部分
- Install phpBB 2 in Windows XP running on Apache 2, PHP 5 and MySQL 4安裝phpbb 2在Windows XP上運行的Apache 2 , PHP 5中和MySQL 4
- Easily Set Up Web Server with XAMPP很容易成立的Web伺服器與xampp
- Subversion (SVN) Issues and Problems on mod_dav_svn in FreeBSD顛覆( svn )問題和困難就mod_dav_svn在FreeBSD上



















May 20th, 2006 03:42 2006年5月20日3時42分
well, I have followed your directions and everyone else’s before this, but no luck.那麼,我都跟隨你的方向和其他所有人的在此之前,但沒有運氣。 After adding the module declaration in the httpd.conf file, when I restart apache i get - syntax error: cannot load specific module.後加入該模塊宣言,在httpd.conf文件,當我重新啟動Apache時得到了-語法錯誤:不能負荷的具體模塊。 all of my paths are correct what is the problem?我所有的路徑是正確的是什麼問題呢?
May 20th, 2006 14:33 2006年5月20日14時33分
Hi Todd, the issue might be related to mod_perl (if you’re using it as ActivePerl).喜托德,這個問題可能與mod_perl (如果您使用它作為activeperl ) 。 If you install Apache/2.2, please use mod_perl that is compiled with Apache 2.2 and not Apache 2.0 for compatibility issue.如果您安裝apache/2.2 ,請使用mod_perl是編制與Apache 2.2 ,而不是的Apache 2.0的兼容性問題。
July 12th, 2006 19:10 2006年7月12日19時10分
I have the server set up and i can read a php file if i start it withhtml tags but it doesnt read the php script i put in. if i dont use the html tags i get a download box when i click on the link to test the php??我有服務器的成立,我可以宣讀了一份PHP文件,如果我啟動它withhtml標籤,但它的doesn't閱讀PHP腳本我提出英寸,如果我不要使用HTML標記,我收到了下載框當我點擊鏈接,以測試PHP的嗎? can u help me!! u可以幫助我!
July 12th, 2006 19:46 2006年7月12日19時46分
Looks like your web server doesn’t parse PHP file and treat it as text file, follow the steps carefully.看起來像您的Web服務器不解析PHP文件並把它當作文本文件,請按照下列步驟仔細。
July 13th, 2006 07:32 2006年7月13日7時32分
ok i reset it and now the server cannot find php5apache2.dll?確定重置它和現在的服務器無法找到php5apache2.dll ? It is in the php folder.這是在PHP的文件夾。 I am using php5.1.4 and apache2.2.2!我使用的php5.1.4和apache2.2.2 !
July 13th, 2006 08:43 2006年7月13日8時43分
I got it to work i uninstalled apache 2.2 and installed 2.0 and followed your steps again and now it is all working:)我得到它的工作i卸載的Apache 2.2和2.0安裝和按照你們的步驟,再次和現在是所有的工作: )
Thank you for the help!感謝您的幫助!
September 10th, 2006 20:48 2006年9月10日20時48分
There seems to be a problem with Apache 2.2 and the PHP dll modules (on Windows obviously, don’t know if there are any problems on unix).似乎有一個問題,與Apache 2.2和PHP的DLL的模塊(在Windows很明顯,不知道如果有任何問題,在UNIX ) 。 I fixed it by going to i固定它去 http://www.apachelounge.com/download/ and downloading their version of the php4apache2.dll file.和下載他們的版本的php4apache2.dll文件。 This also comes with another file which you have to put in your Apache/bin directory, and you will also need to download a MS Visual C++ Package if you don’t have the .NET framework installed.這也與另一檔案,你必須付諸表決,在你的Apache / bin目錄,您還需要下載一個女士的Visual C + +套件如果你不具備的。 NET Framework安裝。 This is all explained in the readme file that comes with the DLL.這是所有解釋,在自述文件附帶的DLL文件。
October 7th, 2006 07:18 2006年10月7日7時18分
With Apache 2.2, you will need PHP 5.2.x.與Apache 2.2 ,您將需要的PHP 5.2.x. It has the php5apache2_2.dll that is compiled for the new version.它有php5apache2_2.dll這是彙編為新版本。 You can download a stable build at您也可以下載一個穩定的興建 http://snaps.php.net/
February 19th, 2007 17:11 2007年2月19日17時11分
You said…你說…
…
Search for the line of extension_dir = “./”.搜索該行extension_dir = "./". Change it to extension_dir = “C:\php5\ext”.將它更改為extension_dir = “為C : \ php5 \分機” 。 Also, uncomment the line of extension=php_mysql.dll.此外,取消對線的延長= php_mysql.dll 。
Save the php.ini.保存php.ini的影響。 Restart the Apache server.重新啟動Apache服務器。 Re-try to access重新嘗試訪問 http://localhost/php5_info.php . 。 It should working fine.它應工作的罰款。 If not try to如果沒有嘗試
….. … ..
….. … ..
“C:\php5\ext”.的“ C : \ php5 \分機” 。 ?????? — the correct line is -正確的路線是
“C:\php\ext”. “將C : \ php \分機” 。
February 19th, 2007 17:23 2007年2月19日17時23分
u forgot a thing, for the apache.. u忘了一件事情,為的Apache ..
modify DirectoryIndex and put index.php修改directoryindex和提出的index.php
in rest is a good tutorial在其餘的是一個很好的補習
February 25th, 2007 01:30 2007年2月25日01:30
I am trying to connect mysql5 from apache2 but我嘗試連接mysql5從Apache2中,但
browser showing an error瀏覽器顯示一個錯誤
” “
Warning: require(/config/db_config.php) [function.require]: failed to open stream: No such file or directory in C:\webroot\dbconnect.php on line 2警告:要求( /配置/ db_config.php ) [ function.require ] :未能打開流:沒有這樣的文件或目錄在C : \的Webroot \ dbconnect.php對2號線
Fatal error: require() [function.require]: Failed opening required ‘/config/db_config.php’ (include_path=’.;C:\php5\pear’) in C:\webroot\dbconnect.php on line 2致命錯誤:需要( ) [ function.require ] :沒有開放所需的' /配置/ db_config.php ' (和include_path = ' 。 ;為C : \ php5 \梨' )在C : \的Webroot \ dbconnect.php對2號線
I am using,MySQL5, PHP5 and Apache2.2 running windows xp我使用的, mysql5 , php5和apache2.2運行Windows XP
Request your help請求您的幫助
Thanking you感謝你
******
February 25th, 2007 01:30 2007年2月25日01:30
I am trying to connect mysql5 from apache2 but我嘗試連接mysql5從Apache2中,但
browser showing an error瀏覽器顯示一個錯誤
” “
Warning: require(/config/db_config.php) [function.require]: failed to open stream: No such file or directory in C:\webroot\dbconnect.php on line 2警告:要求( /配置/ db_config.php ) [ function.require ] :未能打開流:沒有這樣的文件或目錄在C : \的Webroot \ dbconnect.php對2號線
Fatal error: require() [function.require]: Failed opening required ‘/config/db_config.php’ (include_path=’.;C:\php5\pear’) in C:\webroot\dbconnect.php on line 2致命錯誤:需要( ) [ function.require ] :沒有開放所需的' /配置/ db_config.php ' (和include_path = ' 。 ;為C : \ php5 \梨' )在C : \的Webroot \ dbconnect.php對2號線
I am using,MySQL5, PHP5 and Apache2.2 running windows xp我使用的, mysql5 , php5和apache2.2運行Windows XP
Request your help請求您的幫助
Thanking you感謝你
Asokan asokan
June 21st, 2007 13:10 2007年6月21日13時10分
I have succes install apache 2, php5 and MySQL 5.我繼承安裝的Apache 2 , php5和MySQL 5 。 I can display php info.我可以顯示PHP的信息。 But, why php script that I make can not run in the IE browser.但是,為什麼PHP腳本,使我無法運行,在IE瀏覽器。 this simple script like this:這個簡單的腳本是這樣的:
I use Windows XP.我使用的Windows XP 。
Thank you for your attention.謝謝您的關注。