当你发现chrome浏览器console里面报错: Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://xbphp.nmfox.com//Index/article/7.html
其实这个报错是并不是指是代码错误,而是指路径错误.
这种报错其实就你URL从某个页面点击超链接进来才会出现..如果是直接访问就不会出现该错误,那到底是为什么呢?
你可以通过抓包来看一下HTTP状态,你就会发现:
你从某个页面点击进去的时候,这个HTTP请求的状态码500,但是实际页面并没影响而是可以正常访问
你直接从连接访问进去,这个HTTP请求的状态码200
这时候你就会哭笑不得,代码没错,服务器配置检查也没问题,但是为什么还有这个错误,其实一切源头在于linux系统,而win系统完全不会报错,为啥,因为URL路径出现了双斜杠导致….其实linux的路径检验特别严格..
所有由admins发布的文章
github常用命令
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
git add . git status git commit -a -m "hahah" git status git branch git push origin randcard +++++++++++++++++++++++++++ git branch randcard git reset --hard master git checkout randcard |
gulp报340错误module.js:340 throw err; ^ Error: Cannot find module ‘.\vendor\laravel\elixir\Elixir’
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
H:\Binary\nginx\foobar.com>gulp module.js:340 throw err; ^ Error: Cannot find module '.\vendor\laravel\elixir\Elixir' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.<anonymous> (H:\Binary\nginx\foobar.com\Gulpfile.js:1:76) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) |
报340 341错误
1 |
this by changing the first line in Gulpfile.js to var elixir = require('laravel-elixir');, I then updated packages.json with "laravel-elixir": "*",, I then ran npm install again. After that I could run gulp without problem. |
1 |
packages.json 中改
“laravel-elixir”: “*”
然后重装次npm
github的安装目录怎么找不到
windows系统
2016版的github桌面版安装完后发现怎么找不到安装目录
1 |
C:\Users\Administrator\AppData\Local\GitHub\PortableGit_c************9\mingw32\bin\git.exe |
打开这个目录 发现 git.exe 配置到phpstorm中
PHP写startswith和endswith
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
<?php function starts_with($a,$b){ return strpos($a, $b) > 0?true: false; } var_dump(starts_with('I love she','L')); function end_with($a,$b,$lowerorup=1){ // 如果$lowerorup = 0则不用区分大小写 $begin= $lowerorup?strpos($a,$b):stripos($a,$b); if($begin){ echo '开始于第',$begin,'个字符<br />'; echo '结束于',$begin+strlen($b); } } echo '<br />'; end_with('I love she','Lov',0); |
javascript计算器
怎样用JavaScript编译简易计算器??
getElementsByName这个获得的是字符串记得用parseInt转换成int哦
基本的+ – x /
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
<!DOCTYPE html> <html> <head> <title> 事件</title> <script type="text/javascript"> function count1(){ var a=parseInt(document.getElementById('txt1').value); var b=parseInt(document.getElementById('txt2').value); var add4=document.getElementById('select').value; var c=0; switch(add4){ case '+': c= a+b; break; case '-': c= a-b; break; case '*': c= a*b; break; case '/': c= a/b; } document.getElementById('fruit').value=c; } </script> </head> <body> <input type='text' id='txt1' /> <select id='select'> <option value='+'>+</option> <option value="-">-</option> <option value="*">*</option> <option value="/">/</option> </select> <input type='text' id='txt2' /> <input type='button' value=' = ' onclick='count1()'/> <!--通过 = 按钮来调用创建的函数,得到结果--> <input type='text' id='fruit' /> </body> </html> |