在 Windows 上安裝 PHP 5.3 開發環境 - 2

本文详细介绍了如何在D盘上搭建包含Apache、PHP和MySQL的本地WEB服务器环境,并规划了清晰的目录结构,同时设置了环境变量以方便后续操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<!-- [if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning/> <w:DrawingGridVerticalSpacing>7.8 pt</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:SpaceForUL/> <w:BalanceSingleByteDoubleByteWidth/> <w:DoNotLeaveBackslashAlone/> <w:ULTrailSpace/> <w:DoNotExpandShiftReturn/> <w:AdjustLineHeightInTable/> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> <w:UseFELayout/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!-- [if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--><!-- [if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:標準の表; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]-->

安排目錄結構並設定環境變數

和之前一樣,我打算把相關的程式放在 D:/AppServ 底下,而檔案庫則放在 D:/Repository 底下。以下是我所規劃的目錄結構:

D:
|
|- AppServ (
伺服器相關程式
)
| 
|
| 
|- Apache2.2 ( Apache 
的主要程式檔
)
| 
|
| 
|- php ( PHP 
的主要程式檔
)
| 
|
| 
|- mysql ( MySQL 
的主要程式檔及資料檔
)
|
|- WEB
| 
|
| 
|- wwwroot (
預設網站的主要根目錄
)
|
|- Temp
 
|
 
|- php ( PHP 
存放暫存檔案的地方
)
 
|
 
|- upload (
上傳檔案的暫存位置
)
 
|
 
|- session ( Session 
檔的暫存位置
)
 
|
 
|- xdebug ( Xdebug 
分析檔的存放位置
)

這裡我會把預設網站的根目錄放在 D:/WEB/wwwroot ,各位可以依自己的喜好決定它的位置。

接著把 Apache PHP MySQL 的執行檔所在路徑預先加入系統變數 PATH 裡,這樣方便到時候直接使用指令來設定服務,如下:

D:/AppServ/Apache2.2/bin;D:/AppServ/php;D:/AppServ/mysql/bin;%SystemRoot%....

註:放在 D: ( 或其他非 C: 分割區) 的好處是不用擔心重灌後,資料及相關設定會消失。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值