主頁 > 知識(shí)庫(kù) > iis PHP安裝腳本 PHPInstall.vbs V3.1

iis PHP安裝腳本 PHPInstall.vbs V3.1

熱門標(biāo)簽:打電話的外呼系統(tǒng)貴不貴 外呼營(yíng)銷下單系統(tǒng) 新密防封卡外呼系統(tǒng)違法嗎 百度地圖標(biāo)注怎么卸載 前鋒辦理400電話申請(qǐng) 加盟電銷機(jī)器人好的品牌 陜西高頻外呼回?fù)芟到y(tǒng)哪家好 海外美發(fā)店地圖標(biāo)注 辦理膠州400電話財(cái)稅
復(fù)制代碼 代碼如下:

'/*=========================================================================
' * Intro PHP安裝腳本,您所要做的操作是:保存這個(gè)文件與要安裝的php文件夾放一起(不要放在C盤根目錄下)
' * (當(dāng)前版本php-5.2.5-Win32如果是其它請(qǐng)?zhí)鎿Q當(dāng)前文檔相關(guān)文件名),然后雙擊運(yùn)行這個(gè)文件,?phpinfo()?>
' * FileName PHPInstall.vbs
' * Author yongfa365
' * Version v3.1
' * MadeTime 2008-04-01 15:55:41
' * LastModify 2009-05-04 12:21:48
' *==========================================================================*/
Wscript.Echo "開始配置PHP"
phpinstall "php-5.2.5-Win32", "D:\PHP525", "C:"
'phpinstall "php所在目錄","php要安裝到哪","系統(tǒng)盤(如:C:)"

Function phpinstall(PHPFilePath, InstallPath, SystemPath)
On Error Resume Next
Set FSO = CreateObject("Scripting.FileSystemObject")

'WScript.Echo "刪除C:\PHP"
FSO.DeleteFolder InstallPath
FSO.CopyFolder PHPFilePath, InstallPath '第一個(gè)參數(shù)為您要安裝的php文件夾名,他的下一級(jí)是一堆文件及文件夾,而不是只有一個(gè)文件夾

'WScript.Echo "刪除C:\Windows\system32\php5ts.dll及C:\Windows\system32\libmysql.dll,然后復(fù)制新的"
FSO.DeleteFile SystemPath "\Windows\system32\php5ts.dll"
FSO.CopyFile InstallPath "\php5ts.dll", SystemPath "\Windows\system32\php5ts.dll"

FSO.DeleteFile SystemPath "\Windows\system32\libmysql.dll"
FSO.CopyFile InstallPath "\libmysql.dll", SystemPath "\Windows\system32\libmysql.dll"

'MCrypt加密處理
FSO.DeleteFile SystemPath "\Windows\system32\libmcrypt.dll"
FSO.CopyFile InstallPath "\libmcrypt.dll", SystemPath "\Windows\system32\libmcrypt.dll"

'WScript.Echo "讀取C:\php\php.ini-dist內(nèi)容到變量PHPStr"
PHPStr = FSO.OpenTextFile(InstallPath "\php.ini-dist", 1, True).ReadAll

'WScript.Echo "替換配置文件變量PHPStr里的一些參數(shù)"
PHPStr = Replace(PHPStr, ";extension=php_mysql.dll", "extension=php_mysql.dll")
PHPStr = Replace(PHPStr, ";extension=php_gd2.dll", "extension=php_gd2.dll")
PHPStr = Replace(PHPStr, ";extension=php_mbstring.dll", "extension=php_mbstring.dll")
'PHPStr = Replace(PHPStr, ";extension=php_mssql.dll", "extension=php_mssql.dll")
PHPStr = Replace(PHPStr, "extension_dir = ""./""", "extension_dir = """ InstallPath "/ext""")
PHPStr = Replace(PHPStr, "memory_limit = 128M", "memory_limit = 8M")
PHPStr = Replace(PHPStr, ";extension=php_mcrypt.dll", "extension=php_mcrypt.dll")

PHPStr = Replace(PHPStr, ";session.save_path = ""/tmp""", "session.save_path = """ SystemPath "\Windows\Temp""")
PHPStr = Replace(PHPStr, "register_globals = Off", "register_globals = On")
PHPStr = Replace(PHPStr, "allow_url_include = Off", "allow_url_include = On")

'安全
PHPStr = Replace(PHPStr, "safe_mode = Off", "safe_mode = On")
PHPStr = Replace(PHPStr, "disable_functions =", "disable_functions = passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server")
'exec,system,passthru,shell_exec,escapeshellarg,escapeshellcmd,proc_close,proc_open,dl,popen,show_source,ini_alter
'system,exec,passthru,shell_exec,popen

'WScript.Echo "將修改后的配置文件變量PHPStr另存為:C:\Windows\php.ini"
FSO.CreateTextFile(SystemPath "\Windows\php.ini", True).WriteLine PHPStr


Set IIsWebServiceObj = GetObject("IIS://localhost/W3SVC")

'WScript.Echo "添加web服務(wù)擴(kuò)展(打開IIS6-->web 服務(wù)擴(kuò)展-->右擊空白,添加)"
''WebSvcExtRestrictionList,
TempStr = "1," InstallPath "\php5isapi.dll,1,php,php擴(kuò)展"
For Each Str in IIsWebServiceObj.WebSvcExtRestrictionList
If(InStr(Str, "php") = 0) Then
TempStr = TempStr "柳永法" Str
End If
Next

IIsWebServiceObj.WebSvcExtRestrictionList = Split(TempStr, "柳永法")
IIsWebServiceObj.SetInfo

'WScript.Echo "添加應(yīng)用程序擴(kuò)展名映射(網(wǎng)站屬性-->主目錄-->配置-->映射-->添加)"
''ScriptMaps
TempStr = ".php," InstallPath "\php5isapi.dll,5,GET,HEAD,POST,DEBUG"
For Each Str in IIsWebServiceObj.ScriptMaps
If(InStr(Str, "php") = 0) Then
TempStr = TempStr "柳永法" Str
End If
Next

IIsWebServiceObj.ScriptMaps = Split(TempStr, "柳永法")
IIsWebServiceObj.SetInfo



'默認(rèn)首頁
'IIsWebServiceObj.DefaultDoc = "Index.htm,Index.html,Index.asp,Default.aspx,index.php,Default.htm,Default.asp"
'IIsWebServiceObj.SetInfo
If InStr(LCase(IIsWebServiceObj.DefaultDoc), "index.php") = 0 Then
IIsWebServiceObj.DefaultDoc = IIsWebServiceObj.DefaultDoc ",index.php"
IIsWebServiceObj.SetInfo
End If

WScript.Echo "OK,php環(huán)境安裝完成,為了對(duì)本程序作者:柳永法,表示感謝,請(qǐng) 大笑三聲^_^"
End Function

標(biāo)簽:牡丹江 阜陽 武威 四平 咸陽 河南 梅州 伊春

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《iis PHP安裝腳本 PHPInstall.vbs V3.1》,本文關(guān)鍵詞  iis,PHP,安裝,腳本,PHPInstall.vbs,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《iis PHP安裝腳本 PHPInstall.vbs V3.1》相關(guān)的同類信息!
  • 本頁收集關(guān)于iis PHP安裝腳本 PHPInstall.vbs V3.1的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章