当你发现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的路径检验特别严格..
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> |
yii2框架-高级应用程序模板安装
Yii 是在BSD License下发布的一个开源项目。可以免费使用它开发开源或私有的 Web 应用程序。
Yii 2.0怎么安装呢
Yii2的最新版本是 2.0.6,发布于 2015年08月05日。Yii 2.0 在 PHP 5.4.0 版本以上完全重写了Yii。它的目的是成为一个最先进的新一代的PHP开发框架。Yii2.0不兼容1.1。
完整更新日志
升级说明
有两种方式安装Yii 2:使用 Composer,或者下载一份应用程序模板。国内的后者是个不错的选择 因为墙 大家都懂的有vpn就选第一种 吧。
通过 Composer 安装
这是安装Yii2.0的首选方法。如果你还没有安装Composer,先安装。
安装完Composer,运行下面的命令来安装Composer Asset插件:
php composer.phar global require “fxp/composer-asset-plugin:~1.0.0”
现在选择的应用程序模板之一,开始安装 Yii 2.0。应用程序模板是一个包含Yii写的骨架Web应用程序包。
安装基本的应用程序模板,运行下面的命令:
php composer.phar create-project yiisoft/yii2-app-basic basic 2.0.6
安装高级的应用程序模板,运行下面的命令:
php composer.phar create-project yiisoft/yii2-app-advanced advanced 2.0.6
请注意,您可能会被提示安装过程中输入你的 GitHub 的用户名和密码。这是正常的。只要输入它们并继续。
———————————————————–
从归档文件安装
下载以下归档文件之一,然后将其解压缩到一个Web可访问的文件夹:
Yii2的基本应用程序模板https://github.com/yiisoft/yii2/releases/download/2.0.6/yii-basic-app-2.0.6.tgz
Yii2的高级应用程序模板https://github.com/yiisoft/yii2/releases/download/2.0.6/yii-advanced-app-2.0.6.tgz
执行init,选择开发环境(dev)
php /path/to/yii-application/init
创建新的数据库,设置common/config/main-local.php里的components.db数据库信息
使用控制台命令迁移数据库
yii migrate
设置web服务器的根目录
前台/path/to/yii-application/frontend/web/对应的url为http://frontend/
后台/path/to/yii-application/backend/web/对应的url为http://backend/
安装命令 centos下安装ftp命令 yum install vsftpd
安装命令 centos下 yum install vsftpd 出现“Complete!”时安装完成。建用户webname,命令行状态下,在root用户下: //增加用户webname ,并制定testname用户的主目录为/mydata/www/webname useradd -d /mydata/www/webname testname //为 testname设置密码,回车后输入两次相同密码 passwd testname //限定用户 testname不能telnet,只能ftp usermod -s /sbin/nologin testname
chroot_local_user=YES userlist_enable=YES 添加 testname到user_list 中
以下是要更改的选项 将匿名登录禁用。 重要! ESC,冒号wq!回车。 启动vsftpd服务。service vsftpd start
如果是新版的centos7 /bin/systemctl restart vsftpd
|
vsftpd在linux中添加ftp用户ftp553报错解决办法
在linux中添加ftp用户,并设置相应的权限,操作步骤如下:
ftp553报错解决办法
1、建用户webname,命令行状态下,在root用户下:
useradd -d /mydata/www/webname webname //增加用户test,并制定test用户的主目录为/home/test
passwd webname //为test设置密码,运行后输入两次相同密码
3、更改用户相应的权限设置:
usermod -s /sbin/nologin webname //限定用户test不能telnet,只能ftp
4、限制用户只能访问/home/test,不能访问其他路径
vim /etc/vsftpd/vsftpd.conf
修改/etc/vsftpd/vsftpd.conf如下:
#############################
chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd/vsftpd.chroot_list
#############################
编辑上面的内容
#######chroot_list_enable=YES //限制访问自身目录
########vsftpd.chroot_list。//受限制列表
vim /etc/vsftpd/vsftpd.chroot_list
vi编辑vsftpd.chroot_list,将受限制的用户添加进去,每个用户名一行
5、重启vsFTPd服务器
/etc/init.d/vsftpd restart
状态: 开始上传 C:\Users\Administrator\Desktop\index.html
命令: PASV
响应: 227 Entering Passive Mode (100,15,217,15,17,25).
命令: STOR index.html
响应: 553 Could not create file.
错误: 严重文件传输错误
如果报553 Could not create file.是没有创建权限
为所在目录加上权限
chmod -R 777 /mydata/www/webname
谁说css3不能做动画????
谁说css3不能做动画???? w3c教程
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 |
<!DOCTYPE html> <html> <head> <style> div { width:100px; height:75px; background-color:yellow; border:1px solid black; } div#div2 { transform:translate(50px,100px); -ms-transform:translate(50px,100px); /* IE 9 */ -moz-transform:translate(50px,100px); /* Firefox */ -webkit-transform:translate(50px,100px); /* Safari and Chrome */ -o-transform:translate(50px,100px); /* Opera */ } </style> </head> <body> <div>你好。这是一个 div 元素。</div> <div id="div2">你好。这是一个 div 元素。</div> </body> </html> |
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 |
<!DOCTYPE html> <html> <head> <style> div { width:100px; height:75px; background-color:yellow; border:1px solid black; } div#div2 { transform:rotateX(120deg); -webkit-transform:rotateX(120deg); /* Safari and Chrome */ -moz-transform:rotateX(120deg); /* Firefox */ } </style> </head> <body> <div>你好。这是一个 div 元素。</div> <div id="div2">你好。这是一个 div 元素。</div> <p><b>注释:</b> Internet Explorer 和 Opera 不支持 rotateX 方法。</p> </body> </html> |
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 41 |
<!DOCTYPE html> <html> <head> <style> div { width:100px; height:100px; background:red; animation:myfirst 5s; -moz-animation:myfirst 5s; /* Firefox */ -webkit-animation:myfirst 5s; /* Safari and Chrome */ -o-animation:myfirst 5s; /* Opera */ } @keyframes myfirst { from {background:red;} to {background:yellow;} } @-moz-keyframes myfirst /* Firefox */ { from {background:red;} to {background:yellow;} } @-webkit-keyframes myfirst /* Safari and Chrome */ { from {background:red;} to {background:yellow;} } @-o-keyframes myfirst /* Opera */ { from {background:red;} to {background:yellow;} } </style> </head> <body> |