代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
VBS
】
PHP安装脚本
作者:
Dezai.CN
/ 发布于
2011/8/22
/
1014
<div>'/*========================================================================= ' * Intro PHP安装脚本,您所要做的操作是:保存这个文件与要安装的php文件夹放一起(不要放在C盘根目录下) ' * (当前版本php-5.2.5-Win32如果是其它请替换当前文档相关文件名),然后双击运行这个文件,<?phpinfo()?> ' * FileName PHPInstall.vbs ' * Author yongfa365 ' * Version v3.1 ' * WEB <a href="http://www.yongfa365.com">http://www.yongfa365.com</a> ' * Email <a href="mailto:yongfa365@qq.com">yongfa365@qq.com</a> ' * FirstWrite <a href="http://www.yongfa365.com/Item/PHPInstall.vbs.html">http://www.yongfa365.com/Item/PHPInstall.vbs.html</a> ' * From <a href="http://www.yongfa365.com/Item/PHPFirstInstall.vbs.html">http://www.yongfa365.com/Item/PHPFirstInstall.vbs.html</a> ' * 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要安装到哪","系统盘(如:C:)"</div> <div>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 '第一个参数为您要安装的php文件夹名,他的下一级是一堆文件及文件夹,而不是只有一个文件夹 'WScript.Echo "删除C:\Windows\system32\php5ts.dll及C:\Windows\system32\libmysql.dll,然后复制新的" 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内容到变量PHPStr" PHPStr = FSO.OpenTextFile(InstallPath & "\php.ini-dist", 1, True).ReadAll 'WScript.Echo "替换配置文件变量PHPStr里的一些参数" 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服务扩展(打开IIS6-->web 服务扩展-->右击空白,添加)" ''WebSvcExtRestrictionList, TempStr = "1," & InstallPath & "\php5isapi.dll,1,php,php扩展" 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 "添加应用程序扩展名映射(网站属性-->主目录-->配置-->映射-->添加)" ''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</div> <div> IIsWebServiceObj.ScriptMaps = Split(TempStr, "柳永法") IIsWebServiceObj.SetInfo '默认首页 '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环境安装完成,为了对本程序作者:柳永法,表示感谢,请 大笑三声^_^" End Function</div> <div></div>
试试其它关键字
PHP安装脚本
同语言下
.
使用脚本将域账号添加到客户机的本地管理员组
.
删除服务器上文件
.
主动ping服务器是否宕机
.
自动 服务器检查 的vbs脚本
.
VBS脚本发送邮件,密送多人,带附件,可更换账号密码
.
根据文件路径复制文件
.
VBA操作数据库
.
双击获取公网IP到剪贴板
.
定时运行ie浏览执行网址不显示浏览器窗口
.
批处理生成日历
可能有用的
.
C#实现的html内容截取
.
List 切割成几份 工具类
.
SQL查询 多列合并成一行用逗号隔开
.
一行一行读取txt的内容
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
Java PDF转换成图片并输出给前台展示
.
网站后台修改图片尺寸代码
.
处理大图片在缩略图时的展示
Dezai.CN
贡献的其它代码
(
4037
)
.
多线程Socket服务器模块
.
生成随机密码
.
清除浮动样式
.
弹出窗口居中
.
抓取url的函数
.
使用base HTTP验证
.
div模拟iframe嵌入效果
.
通过header转向的方法
.
Session操作类
.
执行sqlite输入插入操作后获得自动编号的ID
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3