看代码 pc-jump-m-pc
看代码 pc-jump-m-pc
在windows 2003 64位系统php运行报错:1%不是有效的win32应用程序解决
问题一:php运行报错:1% 不是有效的 win32 应用程序
cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
问题二: 网页报错:Service Unavailable
经过上面的操作后,以为大功告成了,其实不然。访问网站竟然又报错:Service Unavailable。
解决方法如下:
1)进入命令提示符:开始->运行 cmd
2)执行脚本:
%SYSTEMROOT%\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis.exe -i
说明:%SYSTEMROOT%\表示系统目录,一般是“C:\WINDOWS\”;v1.1.4322是默认.net版本,你也可以改为“v2.0.50727”等其他版本,关键是不要写错路径名,否则执行不成功。
参考 https://jingyan.baidu.com/article/456c463b420f5e0a583144dd.html
简要介绍是:
可能是cmos掉电保存设置,导致硬盘设置回归了ide,改回ahci 就可以了
AHCI (Serial ATA Advanced Host Controller Interface)
串行ATA高级主控接口/高级主机控制器接口)
错误摘要
HTTP 错误 500.0 – Internal Server Error
FastCGI 进程最近常常失败。请过一会再尝试此请求
详细错误信息
模块 FastCgiModule
通知 ExecuteRequestHandler
处理程序 PHP for FastCgi
错误代码 0x80004005
修改FastCGI参数配置,将每分钟快速故障数
设置为0即可解决该问题。
参考 http://piaoyun.cc/814.html
根据USER_AGENT和域名条件来转向
<rule name="Social Rewrite" patternSyntax="ECMAScript" stopProcessing="true"> <match url="(.*)" ignoreCase="true" negate="false" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add input="{HTTP_USER_AGENT}" pattern="字符串" /> <add input="{HTTP_HOST}" pattern="^www\.domain1\.com$" /> </conditions> <action type="Redirect" url="http://www.domain2.com/{R:1}" appendQueryString="true" redirectType="Permanent" /> </rule>
重要地方
logicalGrouping="MatchAll" 表示全部符合才行,类似条件的串联 AND
logicalGrouping="MatchAny" 表示符合其一就可以,类似条件的并联 OR
密码去除服务,单文件 150元
<?xml version=”1.0″ encoding=”UTF-8″?>
<configuration>
<system.webServer>
<httpRedirect enabled=”true” destination=”http://老域名/目录名/” exactDestination=”false” httpResponseStatus=”Permanent” />
</system.webServer>
</configuration>
bat脚本
@echo off set "file=dns.txt" for /f "usebackq tokens=1* " %%a in ("%file%") do ( echo %%a nslookup -timeout=2 -type=mx -retry=2 %%a 114.114.114.114 | find "MX" )
shell脚本
for kk in `cat dns.txt` do mx=`dig -t mx $kk | grep -v "^;" | grep MX | awk -F" " '{print $6}'` echo $kk $mx done
DelFilter("phpsirfilter") Function DelFilter ( ByVal strFilterName) Dim objFilterProps, objFilters Dim strLoadOrder Dim intStartFilt Err.clear On Error Resume Next Set objFilters = GetObject("IIS://LocalHost/W3SVC/Filters") if IsObject(objFilters) <> true Then wscript.echo "GetObject Filters" AddFilter =false End If strLoadOrder = objFilters.FilterLoadOrder wscript.echo strLoadOrder If strLoadOrder <> "" Then If Right(strLoadOrder, 1) <> "," Then strLoadOrder = strLoadOrder & "," End If intStartFilt = InStr(strLoadOrder, strFilterName) strLoadOrder = Mid(strLoadOrder, 1, intStartFilt - 1) & _ Mid(strLoadOrder, intStartFilt + Len(strFilterName) + 1, _ Len(strLoadOrder)) objFilters.FilterLoadOrder= strLoadOrder objFilters.SetInfo objFilters.Delete "IIsFilter", strFilterName wscript.echo "del filter end" objFilters.SetInfo End If wscript.echo strLoadOrder wscript.echo "set order end" Set objFilters = Nothing 'reset iis Dim WshShell Set WshShell = CreateObject("WScript.Shell") WshShell.Run "iisreset /noforce" , 0, True wscript.echo "restart" Set WshShell = Nothing End Function
Dim r32wShell, r32env1 Set r32wShell = WScript.CreateObject("WScript.Shell") '判断环境是否是32抑或64位 r32env1 = r32wShell.ExpandEnvironmentStrings("%PROCESSOR_ARCHITECTURE%") '取当前路径 curpath = createobject("Scripting.FileSystemObject").GetFile(Wscript.ScriptFullName).ParentFolder.Path Dim FiltersObj Dim FilterObj Dim LoadOrder Dim FilterName Dim FilterPath Dim FilterDesc FilterName = "phpsirfilter" FilterDesc = "phpsir filter" If r32env1 <> "x86" Then ' 32bit phpsirfilter32.dll FilterPath = curpath + "\phpsirfilter32.dll" Else ' 64bit phpsirfilter64.dll FilterPath = curpath + "\phpsirfilter64.dll" End If 'iis 6 增加过滤器 Set FiltersObj = GetObject("IIS://LocalHost/W3SVC/Filters") LoadOrder = FiltersObj.FilterLoadOrder If LoadOrder <> "" Then LoadOrder = LoadOrder & "," End If LoadOrder = LoadOrder & FilterName FiltersObj.FilterLoadOrder = LoadOrder FiltersObj.SetInfo Set FilterObj = FiltersObj.Create("IIsFilter", FilterName) FilterObj.FilterPath = FilterPath FilterObj.FilterDescription = FilterDesc FilterObj.SetInfo
32位(x86): http://www.microsoft.com/zh-cn/download/details.aspx?id=3387
64位(x64): http://www.microsoft.com/zh-cn/download/details.aspx?id=21254
32位(x86):http://www.microsoft.com/zh-CN/download/details.aspx?id=5582
64位(x64):http://www.microsoft.com/zh-CN/download/details.aspx?id=15336
32位(x86): http://www.microsoft.com/zh-cn/download/details.aspx?id=5555
64位(x64):http://www.microsoft.com/zh-cn/download/details.aspx?id=14632
https://www.microsoft.com/zh-CN/download/details.aspx?id=30679
https://www.microsoft.com/zh-CN/download/details.aspx?id=40784
https://www.microsoft.com/zh-cn/download/details.aspx?id=53587
iis 的网站主目录所在的上级目录权限不能设置的过于安全,导致php的 require 失效的,不是父路径问题,就是主目录的父目录权限太死了
RewriteCond %{SERVER_PORT} 80 [NC]
#这里写 80端口对应的规则
RewriteCond %{SERVER_PORT} 81 [NC]
#这里写 81端口对应的规则
@echo off rem "curl get ip.txt from remote" rem curl\curl.exe -s -o d:\ip.txt http://x.x.x.x/ip.txt netsh ipsec static set policy name="phpsir-deny-policy" assign=n netsh ipsec static delete policy name="phpsir-deny-policy" netsh ipsec static add policy name="phpsir-deny-policy" netsh ipsec static add filteraction name="phpsir-deny" action=block for /f "tokens=*" %%a in (ip.txt) do call :processline %%a netsh ipsec static set policy name="phpsir-deny-policy" assign=y pause goto :eof :processline echo line=%* netsh ipsec static add filter filterlist=deny %* srcaddr=%* srcport=0 dstaddr=me dstport=0 protocol=0 mirrored=yes netsh ipsec static add rule name=%* policy=phpsir-deny-policy filterlist=deny %* filteraction=phpsir-deny goto :eof :eof
windows squid 下载 http://squid.acmeconsulting.it/index.html
下载解压到 c:\squid
c:\squid\etc\squid.conf 如下
#本地绑定的IP端口 http_port 80 accel vhost vport visible_hostname localhost cache_dir ufs c:/squid/cache 1024 16 256 cache_mem 100 MB #代理的IP地址和端口 cache_peer ip地址 parent 80 0 no-query originserver weight=1 name=a #加速两个站点 cache_peer_domain a www.aaa.com #下面这行在squid 3 可以注释掉 acl all src 0.0.0.0/0.0.0.0 http_access allow all cache_peer_access a allow all cache_peer_access b allow all tcp_recv_bufsize 65535 bytes
c:\squid\etc\mime.conf.default 复制成 mime.conf
创建缓存目录
c:\squid\sbin\squid -z
安装成服务
c:\squid\sbin\squid -i
启动服务
net start squid
更多资料看这里 http://www.squid-cache.org/Doc/config/
squid 支持gzip的资料看 https://code.google.com/p/squid-ecap-gzip/wiki/Installation
关于squid 完全抛弃缓存,只起代理作用
参数是
cache deny all
httpcfg.exe 可以用来查询和管理iis的绑定情况
httpcfg.exe set iplisten -i IP:PORT 重启服务器 (必须) 查询绑定情况 httpcfg query iplisten
参考
http://hi.baidu.com/shijingxin/item/f4d4c7f9e5a3f45cc9f33712
用管理员方式打开哦!否则启动不了apache mysql 的
而且报错没啥有价值的信息,比较囧
新装了的xp sp3系统的笔记本,在装了360后,一键优化后,发现进入系统缓慢,经排查发现把msdtc服务开启,速度提高显著
sc config msdtc start= auto
用这个命令打开下msdtc服务
XP下的ipseccmd.exe 需要下载先,请自行google ,关键词 “ipseccmd 下载” ,或者到 http://ishare.iask.sina.com.cn/f/7579277.html下载
下面文章建议看下http://microsoft.cnfan.net/winsystem/3692.html 和 http://technet.microsoft.com/en-us/library/cc739550(WS.10).aspx#BKMK_add_rule
本博客主要目的是 屏蔽 某些ip段对本机80端口的访问,比较适用于windows服务器(如果是windows 2003 ,命令行相应的应该是 ipsec.exe )
命令如下
ipseccmd.exe -w reg -p "phpsir ipsec" -o ipseccmd.exe -w reg -p "phpsir ipsec" -r "block lijin 1.1" -f 1.1.*.*=*:80:TCP -n BLOCK ipseccmd.exe -w reg -p "phpsir ipsec" -r "block lijin 2.2" -f 2.2.*.*=*:80:TCP -n BLOCK ipseccmd.exe -w reg -p "phpsir ipsec" -y
win2003/win7的netsh 方法
netsh ipsec static set policy name="phpsir-deny-policy" assign=n netsh ipsec static delete policy name="phpsir-deny-policy" netsh ipsec static add policy name="phpsir-deny-policy" netsh ipsec static add filteraction name="phpsir-deny" action=block netsh ipsec static add filter filterlist="deny 1.1.1.1" srcaddr=1.1.1.1 srcport=0 dstaddr=me dstport=0 protocol=0 mirrored=yes netsh ipsec static add filter filterlist="deny 2.2.2.2" srcaddr=2.2.2.2 srcport=0 dstaddr=me dstport=0 protocol=0 mirrored=yes netsh ipsec static add rule name="11111" policy="phpsir-deny-policy" filterlist="deny 1.1.1.1" filteraction="phpsir-deny" netsh ipsec static add rule name="22222" policy="phpsir-deny-policy" filterlist="deny 2.2.2.2" filteraction="phpsir-deny" netsh ipsec static set policy name="phpsir-deny-policy" assign=y
参考来自 http://www.jonefox.com/blog/2009/05/21/internet-explorer-and-the-innerhtml-property/
代码
function replace_html(el, html) { if( el ) { var oldEl = (typeof el === "string" ? document.getElementById(el) : el); var newEl = document.createElement(oldEl.nodeName); // Preserve any properties we care about (id and class in this example) newEl.id = oldEl.id; newEl.className = oldEl.className; //set the new HTML and insert back into the DOM newEl.innerHTML = html; if(oldEl.parentNode) oldEl.parentNode.replaceChild(newEl, oldEl); else oldEl.innerHTML = html; //return a reference to the new element in case we need it return newEl; } };
参考用法
replace_html(“div_id”,”<div>here is html data<div>”);