156行bug与解决方法

首页 编程分享 LINUX丨SYSTEM 正文

袅袅牧童 推荐 转载 编程分享 2018-06-22 00:04:36

简介 门了。现将前156行bug与我的解决方法附上,希望大家在学习时可以少走弯路。



曾经有个老师告诉我,如果我遇到了156种bug并能成功解决,那么可以说这个语言你已经入门了。现将前156行bug与我的解决方法附上,希望大家在学习时可以少走弯路。

bug集合解决方案
1.Warning: Unknown: failed to open stream: Invalid argument in Unknown on line 0

Fatal error: Unknown: Failed opening required ‘F:/php/?±?100??¥??…????????°?’?.php’ (include_path=’.;C:\php\pear’) in Unknown on line 0
问题原因:未知错误:错误的打开方式:在第0行有未知的并且无效的参数
    致命错误:未知:错误的打开命令在“xxx位置”
解决方法:检查路径或者文件名是否含有中文

2.Parse error: syntax error, unexpected T_ECHO, expecting ‘,’ or ‘;’ in F:\php\decbinScale.php on line 26
问题原因:从语法来讲是错误的:语法错误。无法如预期执行的“xx函数”,预期应该有“xx符号”在“xx位置”
解决方法:找到函数错误行数位置,增删符号

3.Notice: Undefined variable: num8的对应十进制值为: in F:\php\decbinScale.php on line 18
问题原因:注意:未定义的函数值:“xx错误函数”:in“xx错误发生位置”
解决方法:找到错误发生位置,查看错误函数是否有语法问题,是否与字符串用空格隔开。

4.Notice: Use of undefined constant n – assumed ‘n’ in F:\php\evenNumberIn100.php on line 56
问题原因:注意,使用了未定义的常量“xx常量名”in”xx第几行”;
解决方法:查看常量拼写是否正确,是否使用$符加以标识;

5.ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near ‘drop
d’ at line 2
问题原因:错误:你有一个错误在你的数据库语法里;请手动配置正确的语法去使用相近的“xx错误语法类型”at”line xx”以符合你的Mysql服务器版本
解决方法:检查语法是否正确,想要操作的对象是否存在

6.ERROR 1046 (3D000): No database selected
问题原因:错误:没有数据文件被选中
解决方法:使用create data base创建文件,或者直接use database文件名;

7.Parse error: syntax error, unexpected $end in F:\php\forLoop.php on line 38
问题原因:从语法来讲是错误的:语法错误,无法如预期的结束定义在“xx行数”
解决方法:检查最后一行是否少了大括号或者其他的结束语句,导致程序无法结束;

8.Parse error: syntax error, unexpected ‘%’, expecting T_VARIABLE or ‘$’ in F:\php\%issetOddOr2n.php on line 10
问题原因:从语法来讲是错误的:语法错误,无法如预期的“xx符号”,预期应该有“xx”或者“xx”在“xx行数”
解决方法:检查改行或者上一行是否有符号错误定义

9.Not Found

The requested URL /modity.php was not found on this server.
问题原因:未找到:这个请求的链接地址“xx。html”没有在服务器找到
解决方法:查看地址拼写是否错误,是否与链接地址对应。

10.Notice: Undefined index: id in F:\php\del.php on line 9
问题原因:注意:未定义的下标:“xx”在“xx行”。
解决方法:检查函数的优先级,查看是否出现短路现象,导致后面没有执行

11.Forbidden

You don’t have permission to access /javascript(void:0) on this server.
问题原因:禁止:你不被允许去访问这个“xx函数”在这个服务器上
解决方法:使用当前环境允许的函数;

12.Parse error: syntax error, unexpected ‘%’, expecting T_VARIABLE or ‘$’ in F:\php\%issetOddOr2n.php on line 10
问题原因:从语法来讲是错误的;语法错误,无法预知的“xx符号”,预期的“xx符号”或者“符号”在“xx行号”;
解决方法:文件名不能含有特殊符号,操作系统不支持。查看自己文件名的命名规则

13.Fatal error: Function name must be a string in F:\php\img.php on line 9
问题原因:致命错误:函数名必须是个字符串在“xx行”;
解决方法:使用常量时候要注意格式,比如$GET[”],必须是中括号

14.ERROR 1075 (42000): Incorrect table definition; there can be only one auto colum
n and it must be defined as a key
问题原因:错误的表格定义,在那个点上只能有一个自动列并且还要定义一个键;
解决方法:不应该用database去定义表格,并且,主键已被定义,自动列也已被定义,可以选择删除键值,或者重新创建表格;

15.ERROR 1146 (42S02): Table ‘php.php’ doesn’t exist
问题原因:表格“xx”不存在
解决方法:检查选择的数据库是否正确,命令格式是否正确,重启mysql服务器试试

16.Notice: Use of undefined constant n – assumed ‘n’ in F:\php\11.19\my99.php on line 12
问题原因:注意:使用的未定义的常量“n”呈现为“字符串形式”在“xx行”
解决方法:没有加$符直接使用了,加上$符定义;

17.Warning: Invalid argument supplied for foreach() in F:\php\11.19\foreach2Array.php on line 16
问题原因:未知错误:为foreach提交了无效的有争议的东西在“xx行”
解决方法:

18.Notice: Undefined variable: m in F:\php\11.20\phpVar.php on line 15

Notice: Undefined variable: n in F:\php\11.20\phpVar.php on line 15
问题原因:注意,未定义的函数“xx函数”在“xx行”
解决方法:检查函数的作用域,是否发生了跨域调用

19.Fatal error: require() [function.require]: Failed opening required ‘Resource id Id3′ (include_path=’.;C:\php\pear’) in F:\php\11.20\workHard.php on line 28
问题原因:致命错误:“xx函数”失败的打开引入,返回资源的id为3号;(xx默认位置)在(xx文件xx行);
解决方法:require不能返回函数,只能引入php文件

20.Warning: require(Resource id Id3) [function.require]: failed to open stream: No such file or directory in F:\php\11.20\workHard.php on line 28
问题原因:警告:命令(资源id为3号)函数的命令:失败的打开嵌入方式:没有这样的文件或者目录在“xx行xx列”;
解决方法:require不能返回函数,只能引入php文件

21.
Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘root’@’localhost’ (using password: YES) in F:\php\11.20\mysql_connect.php on line 9
问题原因:链接数据库失败,拒绝进入
解决方法:检查用户名或者密码,或者查看host里面的站点是否被禁用

22.
Notice: Use of undefined constant mysql_connect – assumed ‘mysql_connect’ in F:\php\11.20\workHard.php on line 28
问题原因:注意,使用了未定义的常量”假定常量为“xx行,xx列”
解决方法:检查自己调用的常量语法是否有错误,检查符号原因

23.Parse error: syntax error, unexpected ‘=’, expecting ‘,’ or ‘;’ in F:\php\11.20\workHard.php on line 67
问题原因:从语法来讲是错误的,语法错误,无法预知的符号“=”,预期额“,号”或者“;”
解决方法:检查函数作用域,看看是否超出了作用域之外

24.Fatal error: Call to undefined function contant() in F:\php\11.20\switchServer.php on line 30
问题原因:致命错误:调用了一个未定义的函数contant()在“xx行”
解决方法:查看使用的函数是否合法,是否为常量,是否有语法错误,是否有环境错误

25.Warning: in_array() expects parameter 2 to be array, integer given in F:\php\11.20\BigSea.php on line 10
问题原因:警告:“xx引用的函数”预料的参数是2个去成为一个数组,给一个整数在“xx行”;
解决方法:检查引用函数的时候是否给了参数,如果给了参数,检查是否有语法错误,尝试加个小括号增加一下优先级

26.Mysql出现2003开头的错误
解决方法:查看host文件是否开启了localhost端口,或者是否开启了多个mysqlchuangk

27.Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in F:\php\mysql11.25\result.php on line 16
问题原因:警告,函数预期的提交应该是一个资源,布尔类型提交在“xx位置”
解决方法:查看自己的字符集是否有冲突,是否有语法错误导致无法提交内容;

28.连接数据库失败错误代码为2002错误方式为php_network_getaddresses: getaddrinfo failed: 不知道这样的主机
解决方法:查看主机是否填写错误

29.办法一: 用 sc.exe 这个 Windows 命令 开始——运行——cmd.exe,然后输入 sc 就可以看到了.使用办法很简单: sc delete “服务名” (如果服务名中间有空格,就需要前后加引号) 如针对上面的: sc delete ConnectMON
解决办法:删除服务

30.sql语句有语法错误!
错误编码是1064
错误信息是You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘=={’11’} and password=={‘6512bd43d9caa6e02c990b0a82652dca’}’ at line 1
解决方法:单引号加错了地方,导致语法不能解析,NEAR关键字就是在旁边,后面跟的是“错误的语法”

31.Fatal error: Unsupported operand types in F:\php\11.30maopap\text.php on line 60
问题原因:致命错误;无法解析的操作类型,在xx行;
解决方法:操作方法错误,语法有问题

32.Warning: array_rand() [function.array-rand]: Second argument has to be between 1 and the number of elements in the array in F:\php\11.30maopap\text.php on line 79
Warning: Invalid argument supplied for foreach() in F:\php\11.30maopap\text.php on line 80
问题原因:警告,函数array_rand :第二个参数必须跟着第一个元素后面,并且数值元素在数组中;
警告,未知的参数在foreach中
解决方法:因为把一个二维数组直接添加到了另一个混合数组中,再使用array_rand函数就会报错,提示参数错误

33.warning: array_rand() expects parameter 1 to be array, boolean given in F:\php\11.30maopap\text.php on line 79
问题原因:警告array_rand预期的参数1去成为一个数组,布尔型传址了在xx行;
解决方法:因为把一个二维数组直接添加到了另一个混合数组中,再使用array_rand函数就会报错,提示参数错误

34.ERROR 1005 (HY000): Can’t create table ‘test.my_foreign’ (errno: 150)
问题原因:无法创建表格,test下的xx表格,错误号150;
解决方法:外键链接的地址不对,检查下references后面跟的表格信息是否正确

35.ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint f
ails (`test`.`my_foreign1`, CONSTRAINT `student_class_1` FOREIGN KEY (`c_id`) RE
FERENCES `schools` (`id`))
问题原因:不能增加或者更新一个子行:一个外键约束失败了xx字段名引用xx字段
解决方法:增加表内容时,没有考虑引用字段的内容,过界了;无法对应导致报错;

36.ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constrai
nt fails (`test`.`my_foreign1`, CONSTRAINT `student_class_1` FOREIGN KEY (`c_id`
) REFERENCES `schools` (`id`))
问题原因:不能删除或者更新一个父行,一个外键被约束失败来自xx字段引用了xx表的xx字段;
解决方法:本字段被外键的子表引用了数据,导致无法更改,可以尝试从子表删除此引用,或者更新本表其他未被引用的数据

37.ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint f
ails (`test`.`my_foreign1`, CONSTRAINT `student_class_1` FOREIGN KEY (`c_id`) RE
FERENCES `schools` (`id`))

问题原因:不能添加或者更新一个子行,一个外键约束,无法被引用;
解决方法:无法联系到父表的信息,可能是父表内容已经发生了变化

38.ERROR 1067 (42000): Invalid default value for ‘sex’
问题原因:无法解析的默认值为xx列
解决方法:设置字符集为gbk

39.ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: N
O)
问题原因:用户访问拒绝xx用户(using password:no);
解决方法:密码错误,重新输入密码

40.unable to start screensaver.switch –lol-launcher required.
问题原因:无法访问,需要一个参数
解决方法:现在提示框中ctrl+c,把错误提示显示在文本编辑器中,添加参数,为switch和require之间的一段话,

41.Fatal error: Using $this when not in object context in F:\php\object\object.php on line 52
问题原因:致命错误,没有在对象的环境使用$this 在xx行
解决方法:this函数只能在函数里面调用

42.Fatal error: Access to undeclared static property: a1::$v1 in F:\php\object\object.php on line 89
问题原因:致命错误,访问了一个未经定义的静态属性:xx在xx行
解决方法:调用一个静态的属性 (在静态方法中,不能用this调用实例属性,当然,也不能用self调用实例属性,self好像只能调用静态属性???)

43.ERROR 1265 (01000): Data truncated for column ‘id’ at row 1
问题原因:插入了一个now()只能用于时间日期,是一个函数
解决方法:插入一个null,会自增长

44.ERROR 1136 (21S01): Column count doesn’t match value count at row 1
问题原因:列无法计算匹配值在第一行
解决方法:只复制数据,不复制结构,会导致无法匹配

45,ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near ” at
line 1
问题原因:语法问题
解决方法:解决方法,查看是否有单词错写,符号忘加

46.ERROR 1241 (21000): Operand should contain 1 column(s)
问题原因:运算对象必须包含一行
解决方法:如果运算多个对象,不要用等号,用in

47:ERROR 1242 (21000): Subquery returns more than 1 row
问题原因:返回值超过了一行
解决方法:查询的内容超过了一行

48.ERROR 1248 (42000): Every derived table must have its own alias
问题原因:作为源数据表必须有一个bieming
解决方法:给表去一个别名

48.Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 24 bytes) in F:\php\test.php on line 17
问题原因:致命错误:内存大小超出
解决方法:查看算法是否出现死循环

49.音量图标消失的解决办法
win+x可以挑出来右下角工具栏的所有图标

50.Notice: Undefined property: MySQLDB::$link in F:\php\object\mysql.php on line 25
问题原因:提示,未定义的性质:xx在xx行;
解决办法:给函数封装好

51.Warning: mysql_close() expects parameter 1 to be resource, null given in F:\php\object\mysql.php on line 25
问题原因:警告:xx预期的参数是一个资源,却赋了一个空值在xx行
解决方法:不要尝试去给出一个布尔型或者null值

52.Notice: Use of undefined constant php – assumed ‘php’ in F:\php\file_sysetem.php on line 10
问题原因:提示,使用了未定义的php常量
解决方法:使用定义的常量,变量是否当做常量用了
53.Warning: Division by zero in F:\php\file_sysetem.php on line 10
问题原因:警告:使用空分割在xx行
解决方法:分割符是否加在了合适的地方
54.Warning: mkdir() [function.mkdir]: Invalid argument in F:\php\file_sysetem.php on line 10
resource(3) of type (stream)
问题原因:警告,mkdir预期的变量再xx行必须是3个流式的资源型类型
解决方法:给出合适的参数
55.Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in F:\php\mvc\upload:问题原因:函数创建图片时出错
解决办法;把文件上传格式的png和jpeg分别写出

56:Notice: A session had already been started – ignoring session_start() in F:\php\12.15\code.php on line 29
问题原因:提示,一个会话已经开始了,重复开启在29行;
解决办法:关闭浏览器,不要重复开启session;或者注释掉开启session的当前行

57.Warning: Division by zero in F:\php\pdo\pdo.php on line 7
问题原因:警告:用空分割在xx行
解决方法:查看分割符。是否正反斜杠用错

58:Fatal error: No code may exist outside of namespace {} in F:\php\pdo\sonname.php on line 37
错误原因:致命错误:没有代码存在外边在命名空间中在xx行
解决办法:定义一个空的namespace即可(不带名字的namespace)
59:Fatal error: Uncaught exception ‘PDOException’ with message ‘SQLSTATE[42000] [1049] Unknown database ‘student” in F:\php\pdo\pdo1.php:6 Stack trace: Id0 F:\php\pdo\pdo1.php(6): PDO->__construct(‘mysql:host=loca…’, ‘root’, ‘root’) Id1 {main} thrown in F:\php\pdo\pdo1.php on line 6
问题原因:致命错误,无法捕捉到例外的pdo例子,从信息中获取不到数据库的存在
解决方法:查看是否数据库是否存在

60:Fatal error: Non-static method PDO::query() cannot be called statically in F:\php\pdo\pdo1.php on line 9
问题原因:
解决方法:调用了一个不存在的静态方法,尝试使用实例方法去调用,或查看该方法的属性是否为静态

61.Warning: Cannot modify header information – headers already sent by (output started at F:\love\index.php:93) in F:\love\msgBoard\conn.php on line 3
问题原因:不能修改header头信息,header头已经发送在index里面了
解决办法:查看引用的页面是否已经包好有header头

62.Notice: Undefined variable: _SESSION in F:\bbs\register_save.php on line 6
问题原因:注意,函数_session未定义
解决方法:开启session

63.Fatal error: Cannot redeclare mysuccess() (previously declared in F:\bbs\conn.php:12) in F:\bbs\conn.php on line 14
问题原因:致命错误:无法重新声明或者定义xx函数,在xx行已经定义好了
解决方法:查看是否包含的页面已经包含了其他的含有这个函数的页面,导致函数重载

64.Fatal error: Cannot access empty property in F:\php\interface\huai.php on line 12
问题原因:致命错误:无法访问一个空的内容在xx行
解决办法:查看调用的属性是否存在

65:Notice: Trying to get property of non-object in F:\php\interface\school_assignment4.php on line 9
问题原因:提示,尝试去获得一个功能在非对象下载xx行
解决方法:查看使用的对象是否实例化了

66.Fatal error: Call to a member function showInfo() on a non-object in F:\php\interface\school_assignment4.php on line 14
问题原因:致命错误:调用了一个成员函数xx在一个非对象下在xx行
解决方法:在类中实例化一个对象,属性只有类的标准属性,与后续添加的属性无关。而且,在类中实例化之后,还要再类外再次实例化一个对象来调用方法,因为函数不会自动执行

67.Strict Standards: Non-static method Student::readMe() should not be called statically in F:\php\interface\classUsePublic.php on line 16
问题原因:严格标准:不严格的方式用类去调用一个方法,停止使用静态方法去调用方法
解决方法:成员方法应该用对象去调用,静态方法和静态属性才应该用类去调用

68.Catchable fatal error: Object of class Student could not be converted to string in F:\php\interface\text.php on line 15
问题原因:可以捕捉的致命错误:类的对象xx不应该转换为字符串在xx行
解决方法:常量一旦定义,不能修改。检查是否尝试给一个常量赋值,或者变量语法格式错误,或者尝试把一个类当成字符串输出

69.Strict Standards: Creating default object from empty value in F:\php\interface\text.php on line 15
问题原因:严格标准,创建一个默认对象从一个空值中在xx行
解决办法:检查对象是否存在

70.Fatal error: Constructor Student::__construct() canno惊天interface\text.php on line 11
问题原因:致命错误:构造方法xx不能是静态的在xx行
解决方法:改成公共的属性;

71;Strict Standards: Declaration of itStudent::showInfo() should be compatible with that of Student::showInfo() in F:\php\classMultiType.php on line 26
问题原因:严格标准,声明子类必须要兼容和xx父类
解决办法:子类和父类的参数个数要对等,检查是否在继承的时候重写了方法,导致参数不对等

72.
Fatal error: Access level to itStudent::showInfo() must be public (as in class Student) in F:\php\classMultiType.php on line 26
问题原因:致命错误,使用等级必须是一个公共的,作为一个学生类
解决办法:权限必须是public,因为子类权限不得低于父类

73.Fatal error: Cannot make static method Student::showInfo() non static in class itStudent in F:\php\classMultiType.php on line 26
问题原因:致命错误,不能使用一个静态的方法在一个空的静态类中在xx行
解决方法:父类是静态的,子类也必须是静态的

74.Warning: Call to private Db::__destruct() from context ” during shutdown ignored in Unknown on line 0
问题原因:警告,调用了一个私有的方法在环境环境关闭被忽略的时候
解决办法:析构和解析方法都必须是公共的,否则自动调用时会报错

75.SIOCSIFADDR: Operation not permitted
ethe: ERROR while getting interface flags: No such device
问题原因:操作未许可,ethe:错误的获取接口标记:没有这个设备
解决办法:

76.ping ip 地址显示对方主机无法访问,内外都无法ping通
解决方法:把网络连接模式改成自定义的虚拟网卡连接。

77.cp: omitting directory ‘tmp’
问题原因:遗漏的目录tmp
解决方法:tmp不可操作

78:linux可执行文件拒绝访问
解决方法,切换到管理员权限,chmod 777 要执行的文件

79.
Fatal error: Class ‘\App\Controller\StudentController’ not found in F:\blog\index.php on line 20
问题原因:致命错误:类xx没有找到,在xx行
解决方法:少写了个标点符号

80。install-sh:Permission denied
问题原因:某个文件没有访问权限
解决方法:使用chmod 777 授权,或者make clean 清除一下缓存

81。Warning: PDO::__construct() [pdo.–construct]: MySQL server has gone away in F:\blog\Frame\Vendor\PDOWrapper.class.php on line 32

Warning: PDO::__construct() [pdo.–construct]: Error while reading greeting packet. PID=4168 in F:\blog\Frame\Vendor\PDOWrapper.class.php on line 32

Fatal error: Maximum execution time of 30 seconds exceeded in F:\blog\Frame\Vendor\PDOWrapper.class.php on line 32

问题原因:警告:pdo的构造函数,
解决方法:无法连接到数据库,查看端口号的配置信息,和数据库的选择信息是否正确

82.Notice: Undefined property: Frame\Vendor\Smarty::$left_limiter in F:\blog\Frame\Vendor\Smarty\Smarty.class.php on line 705

Fatal error: Uncaught –> Smarty: Unable to load template file ‘indexhtml’ <-- thrown in F:\blog\Frame\Vendor\Smarty\sysplugins\smarty_internal_templatebase.php on line 127 问题原因:注意,未定义的受保护得:xx变量在xx行 致命错误:致命错误:无法捕捉的smarty对象,无法去加载视图文件xx,在xx文件中的xx行 解决办法:链接文件不是常量,要加引号以区分      83.Fatal error: Uncaught --> Smarty: Unable to load template file ‘index.html’ <-- thrown in F:\blog\Frame\Vendor\Smarty\sysplugins\smarty_internal_templatebase.php on line 127 问题原因:致命错误,无法捕捉的smarty对象:无法去加载模板文件“xx文件”,在xx文件的第xx行 解决办法:文件路径错误 84。 Warning: preg_match_all() [function.preg-match-all]: Compilation failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 3 in F:\blog\text.php on line 6 问题原因:警告:匹配函数【】编译错误:PCRE匹配算法无法支持\L\l\N{name},\U,or,\u在边界3在xx文件的xx行 解决方法:将匹配汉子的正确表达式替换为\x{4e00}-\x{9fa5} 85.Fatal error: Uncaught --> Smarty: Call of unknown method ‘delete’. <-- thrown in D:\blog\Frame\Vendor\Smarty\libs\sysplugins\smarty_internal_templatebase.php on line 819 问题原因:致命 错误:午饭捕捉的smarty对象:调用了未知的方法xx方法;异常抛出在xx文件xx行 解决办法:smarty对象本身没有这个方法,强制调用就是未知 86.问题原因:sql语句没有错误,在cmd下可以执行,pdo执行却返回0 解决办法:这个想不起来了,当时好像是一个特别简单的错误解决办法,重写一遍sql语句就行了 87.问题原因:js无法执行, 解决办法:打开firebug查看是否有语法错误; 88.问题原因:sql语句正确,使用cmd能执行,使用pdo执行却返回0 解决方法:查看是否是有一个固定的值给覆盖掉了,以后遇到这种问题,多设置几个属性,来确定是不是某一个属性被固定重写了 89.This XML file does not appear to have any style information associated with it. The document tree is shown below. 问题原因:这个xml文件没有拥有任何的样式信息关联去显示.这个文档树显示在下面 解决办法:谈不上解决,浏览器兼容问题,火狐浏览器,在

90.Js没有语法错误,却无法正确触发,并且显示某个属性未定义
解决方法:把js拖动到网页加载的最后边,看看是不是网页运行顺序的原因

91.text.html:20 Uncaught TypeError: Cannot read property ‘getElementsByTagName’
of null
at XMLHttpRequest.xhr.onloadend (text.html:20)
问题原因:在调用ajax返回数据时无法调取返回结果.提示内容为:无法捕捉的错误类型:无法阅读受保护的”方法”在null中,在某某文件某某行
解决方法:
在设置字符集时,类型写错了,最后的内容类型无法解析,成了null,所以报错xhr.setRequestHeader(“content-type”, “application/x-www-form-urlencoded”);

92:error:Failed dependencies;
问题原因:错误:错误的依赖关系
解决方法:这是在linux中常见的错误,是因为安装的软件相互依赖,必须按照相应的顺序进行卸载

93.admin无权在xx主机上运行sudo.此事将被报告
问题原因:用户授权时写的主机地址是localhost,而现在用的不是,是自定义的主机名
解决方法:把授权sudoers中的location改成现在自定义的主机名就行了,如果还不行,就输入whereis xx,查看这个命令所在的lujing

94.有时候,实在不知道哪里出错了,就重启下机子,有奇效
血的教训~!!!!!

95:cmd窗口显示’xxx’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
问题原因:这个命令没有加入环境变量
解决办法:在环境变量中加入想要使用的应用

96.error: Failed dependencies:
httpd >= 2.2.0 is needed by (installed) gnome-user-share-2.28.2-3.el6.i686
问题原因:文件有依赖关系导致无法卸载
解决方法:强制卸载,忽略依赖关系,在后面加上–nodeps
[root@huaix ~]Id rpm -e httpd-2.2.15 –nodeps

97.localhost无法连接,apache无法启动,并且语法正确
问题原因:主机名正确,但是host文件中的主机名没有对应,所以这个连接地址不存在
解决方法:要么更改主机名,要么更改host文件

98.include(CactiveRecord.php) [function.include]: failed to open stream: No such file or directory
问题原因:包含(xx文件)[src连接]:失败去打开这个流媒体文件:没有这个文件或者目录
解决方法:查看文件的名称是否正确,大小写是否区别(这个是yii中报的错,所以是因为对大小写敏感造成的类文件无法加载)

99.文本域如何固定大小
解决方法:<textarea style="resize:none;">

*_*硬是凑够了99行bug
100.php403fobidden,
问题原因:无法打开项目,提示无权限
解决方法:配置虚拟主机,把显示方式改成以列表显示
在第二行加入这句话
Options +Indexes +FollowSymLinks +ExecCGI

101:Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in D:\51ledai\system\template\template.php on line 643
问题原因:不赞成的:替换:这个xx更改者是不赞成的.使用xx函数代替在xx文件xx行
解决方法:这个可以忽略,因为不是致命错误

102.Warning: Cannot modify header information – headers already sent by (output started at D:\51led,ai\system\template\template.php:643) in D:\51ledai\system\common.php on line 2706
问题原因:警告:无法修改头部信息;头部信息已经被发送在(输出开启在xx文件xx行),在xx文件xx行
解决方法:这个是头文件被重载了,应该是缓存的问题,清楚缓存,并删除runtime里面的文件

103.无法加载控制器:Index
错误位置
FILE: D:\project\tptest\ThinkPHP\Library\Think\App.class.php  LINE: 101
问题原因:无法加载控制器,查看代码和路径都没有问题
解决方法:命名空间和引入文件是否正确

104.模板不存在:./application/Admin/View/Index/index.html
错误位置
FILE: D:\project\tptest\ThinkPHP\Library\Think\View.class.php  LINE: 110
问题原因:提示模板不存在
解决方法:在TP中,任意一个控制器的默认模板,都是这个控制器的名字建立的文件夹,可以自己在diplay中写入要显示的值

105.D:\project\lagou\vendor\laravel\framework\src\Illuminate\Encryption\Encrypter.php line 66:
Call to undefined function openssl_encrypt()
问题原因:

106.PHP warning

date(): It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone ‘UTC’ for now, but please set date.timezone to select your timezone.
问题原因:时区没有设置或者调用了不可用的时区函数
解决方法:在php.ini配置文件中查看自己的timezone是否设置正确,一般设置为prc

107.This method is invoked when the request parameters do not satisfy the requirement of the specified action.
330 * The default implementation will throw a 400 HTTP exception.
问题原因:这个方法触发在请求过后当请求参数不满足这个特殊的视图中的要求,当这个默认方法将要抛出400服务器异常的时候
解决方法:这个原因是因为直接访问,而函数的形参部位又标识了接收变量,导致出错,缺少参数.通过路径去访问页面并正确传值

108.yii提示Undefined variable: goods_model
问题原因:该函数未成功传值到模板中
解决方法:查看往模板赋值的函数,是否有语法错误

109.为什么在传值的时候要以键值对的情形存在,如果是本身就是数组了,前面的键值是不是就是一个字符串,不是的话,为什么会改变
解决方法:前面的相当于一个变量,后面的在发送的时候回转化为真实的数据,发送到模板后就可以直接解析这个变量得到里面的值,如果是一个单一变量,要加$符,如果是foreach,在tp中不用加,因为语法规定,name=””;

110.两个bug,一个是在验证码类中修改边距无效,因为中间的驼峰没有加,变量无法被系统识别
第二个是,在查表中,数据都能获取到,但是单独输出无效.因为下标不对,没有加前缀

111.Unable to connect to a repository at URL ‘svn://localhost’,No repository found in ‘svn://localhost’
问题原因:无法连接到仓库通过地址xx,没有在这个连接里发现地址
解决办法:开启服务器地址时没有指向仓库地址,而是指向了项目地址,导致无法找到仓库地址的报错

112.404notfound
问题原因:请求的资源不存在
解决办法:查看资源路径以及获取方式是否有错

113.1062:Duplicate entry ‘jhhjk ‘ for key ‘doc_title’ [ SQL语句 ] : INSERT INTO `oa_doc` (`doc_title`,`doc_content`,`doc_author`,`doc_ctime`,`doc_file`) VALUES (‘jhhjk ‘,’

jhgklhilk

‘,’1′,’1487352234′,’./Upload/2017-02-18/58a731aabff9f.png’)
问题原因:为某个字段复制入口时出错,因为这个字段已经有了这个名字并且是唯一键
解决方法:字段重复,唯一键

114.field(‘doc_id,doc_id,doc_title,doc_file,
user_nickname,doc_ctime’)
->join(‘left join oa_user u on d.doc_author=u.user_id’)
->select();
解决方法:字段一个单引号,不要每一个都加

115.thinkphp 不存在的图像文件
解决方法:是路径问题,Upload前面一定要加上 ./

116.YII:CException

Property “User.user_name” is not defined.
问题原因.受保护的某个方法未定义
解决方法:检查自己的这个方法名是否写错,大小写是否正确,yii框架中这个方法是否定义

117.Sublime Text
plugin_host has exited unexpectedly, plugin functionality won’t be available until Sublime Text has been restarted
问题原因:启动sublime编辑器后提示这个配置主机存在无法解析的东西,插件功能有效要到sublime编辑器重启之后
解决方法;重启sublime可以短时间解决,

118.PHP notice
Array to string conversion
问题原因:数组转换字符串
解决方法:这个是吧数组当成字符串echo时
出现的错误,检查是否有地方出现不当输出

119.memcached.exe: option requires an argument — d
Illegal argument “?”
问题原因:配置项返回的参数–d含有非法参数
解决方法:这个问题是只指定了参数,没有指定具体命令,把命令参数也加在后面就行了

120.memcache 在进程中查不到,无法进行共享内存
解决方法:在启动memcache的时候,不要加-d参数,直接写start,就能把进程卡出来了.

121.Uncaught TypeError: Cannot use ‘in’ operator to search for ‘4’ in Array
at s (jquery.1.11.min.js:2)
at Function.each (jquery.1.11.min.js:2)
at Object.success (index:179)
at j (jquery.1.11.min.js:2)
at Object.fireWith [as resolveWith] (jquery.1.11.min.js:2)
at x (jquery.1.11.min.js:4)
at XMLHttpRequest.b (jquery.1.11.min.js:4)
问题原因:无法捕捉的错误类型:无法使用in操作数去在数组里面搜索’4′
解决办法:把数据传输改成json格式就行了

122.Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at admin@phpStudy.net to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log
问题原因:内部服务器出错,这个服务偶然的一个内部错误或者丢失配置并且无法去编译你的请求;请联系这个服务的管理员通过xx邮箱去通知他们这个错误发生的时间,并且这个检查你的在这个错误之前执行过得程序.很多内部关于错误可能有效的在这个服务错误日志中
解决方法:刷新一下页面就行了,服务器炸了

123.Unigram dictionary load Error
问题原因:开启coreseek时提示双word词典加载失败
解决方法:unigram,bigram,trigram,是自然语言处理(NLP)中的问题。
unigram: 单个word ||bigram: 双word||trigram:3 word
西安交通大学:
unigram 形式为:西/安/交/通/大/学
bigram形式为: 西安/安交/交通/通大/大学
检查词典路径是否正确
这个是里面的 charset_dictpath = D:/project/sphinx/etc/路径没有配置正确导致的

124.
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in D:\project\test\sphinx.php on line 24
问题原因:即将过时的:xx命令:这个mysql扩展即将过时并且被移除在将来,使用mysqli或者pdo替代ta
解决方法:提示性错误,无影响

125.500 Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request
问题原因:域名无法访问。
解决方法:服务器目录,虚拟主机配置出错

126.
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv='refresh' content='0;url="http://10.254.0.1:64713/nas_notice.htm?to=2017-03-01 23:59:59&url=http%3A%2F%2Fwww%2Ephpstudy%2Enet%2Fphpstudy%2Fver%2Ephp%3Fsoft%3Dphpstudy"'>” is not a valid integer value.
问题原因:phpstudy报的错,很奇怪
解决方法:根据报错分析是传了一个不是整形的数

127.微信开发者工具中默认选中token
解决方法:可以在第一个下拉列表中选择更多的推广选项

128.
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 24 bytes) in D:\project\ThinkPHP\Library\Think\Db\Driver.class.php on line 299
问题原因:超出最大可执行内存
解决方法:ini_set(‘memory_limit’,’500M’);临时修改ini配置文件

129.git 使用ssh put提示cant’read,access denied
问题原因:无法阅读,没有权限
解决办法;重新生成key,把以前的key删除掉

130.当前网页无法识别么meta标签,字符集默认是ansi,网页显示乱码
解决方法:把文件另存为,然后选择字符编码为utf-8就能解决了.

131.CException

Property “LoginForm.admin_password” is not defined.
问题原因:yii中前台使用的用户登录表单校验,在后台中更改了部分数据,导致出现此错误
解决方法:小物件生成的表单中有这个错误的字段,排查一下;另,记得包含想要使用的类文件

132.500 Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at admin@phpStudy.net to inform them of the time this error occurred, and e actions you performed just before this error.

More information about this error may be available in the server error log.

问题原因:500是服务器错误,内部服务错误,这个服务器偶然遇见了一个内部错误或者丢失了配置文件,导致无法去处理你的请求,请联系管理员,更多的错误信息,或许在服务器日志里

解决方法:这个是重写模式的文件语法格式不正确,导致的服务器加载这个错误文件时报错.解决方法,任意换一个重写文件

133.No input file specified.
问题原因:没有输入特殊文件
解决办法:这个也是重写模式的.htaccess中的配置不正确,在index后加个问号就行了

134.ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using;password: NO)
问题原因:访问拒绝,密码错误
解决方法:这个其实比较低级的错误,就是忘记密码了.但是我遇到的是第二种情况,应该是在windows下更改的密码,然后linux服务器的字符编码不一致,导致密码转义了.更改my.cnf跳过配置,然后重设一个密码吧

135.HTTP Error 404

404 Not Found

The Web server cannot find the file or script you asked for. Please check the URL to ensure that the path is correct.

Please contact the server’s administrator if this problem persists.
问题原因:无法找到的404错误,这个属于http协议无法正确请求
解决方法:检查当前所用的http协议,格式是否正确

136.同上,没有权限,或者拒绝访问
解决方法:本地把http协议去掉,直接www开头就能用

137.SSL certificate problem:unable to get local issuer certificate;
问题原因:无法获取到证书和ssl协议
解决方法:在curl进行网站爬取的时候加上CURLOPT_VERIFYPEER,false;CURLOPT_VERIFYHOST,false;

138.“client request’s parameters are invalid, invalid openid”
问题原因:客户端返回参数不正确,错误的openid
解决方法:这个是在调用,候报的错误,解决方法是定义两次$qc= new qc(),在第二次传token和openid传进去,防止变量丢失或者被覆盖

139.AH00112: Warning: DocumentRoot [D:/Apache24/htdocs] does not exist
问题原因:配置https配置的时候报这个错误
解决办法:把上面的默认配置删除就行了

140.Bad Request

Your browser sent a request that this server could not understand.
Reason: You’re speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.
问题原因:在访问https网站的时候不加前缀并且后面写了端口
解决方法:在前面加上https即可

141:Call to a member function display() on a non-object
问题原因:不存在的对象调用了一个方法
解决方法:这个问题比较常见,这次这个bug出现在一个登陆控制的中间类中。中间类继承基础类,普通类继承中间类,然而中间类的构造方法中没有基础类丰富的属性,会导致好多方法无法调用。这时候需要在中间类的构造方法中调用父类的构造方法:Parent::__construct();

142:ajax请求200,却接受不到数据。
解决方法:点击netword中的请求链接,里面有报错信息,也许是其他错误阻碍了输出,比如语法错误

143.No package mariadb-server available.
Error: Nothing to do
问题原因:配置云服务器时使用yum一键安装的提示
解决方法:到这个网页去下载个脚本https://help.aliyun.com/knowledge_detail/41177.htm,然后执行后就可以自动检测源文件了

144.远程连接数据库被拒接
解决方法:授权所有端口访问mysql > grant all on *.* to ‘php55’@’%’ identified by ‘123456’;

145.configure: error: You need a C++ compiler for C++ support.
解决方法:yum install -y gcc gcc-c++

146.Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
No package mariadb-server available.
Error: Nothing to do
售后工程师 : 您好、建议注释一下/etc/apt/apt.conf 中的proxy行代理信息之后再测试一下呢。

147.gzip: stdin has more than one entry–rest ignored tar: Child returned status 2 tar: Error is not recoverable: exiting now
解决方法:使用unzip方法

148._STORAGE_WRITE_ERROR_
解决方法:chmod -R 777 Runtime ,这个是文件的写入权限设置有问题

149.[emerg]: unknown directive “if(!-e” in /usr/local/nginx/conf/nginx.conf:124
解决方法:if和(之间必须有个空格

150.nginx: [emerg] “root” directive is duplicate in /etc/nginx/server/blogs.conf:7
nginx: configuration file /etc/nginx/nginx.conf test failed
解决方法:在配置文件时,访问路径设置了两个,重复配置导致

151.could not read symbols: Bad value
collect2: ld returned 1 exit status
解决方法:编译动态库出错,在编译的过程中加上fpic参数就行!方法为:修改命令为:
./config shared zlib -fPIC
则make && make install 没有问题了。如果是以依赖形式安装的话就在–with后面加上–with-fpic就行了

152.svnserve: Can’t bind server socket: Address already in use
问题原因:开启svn仓库时出现报错,不能绑定服务器
解决方法:这是端口冲突引起的,一个是kill掉以前的,一个是启动时后面加端口 –listen-port 3691

153.File not found: transaction ‘1-1’, path ‘/svnconf/a.txt’
问题原因:写了个关联脚本后提交失败
解决方法:文件没有找到,这个可能是svn的路径发生了改变

154.Target path ‘/svnconf’ does not exist
问题原因:提交时提示我的仓库路径不存在
解决方法:文件没有找到,这个可能是svn的路径发生了改变。建议重新尝试check out,如果还不行,就是svn开启的路径改变了

155.post-commit hook failed (exit code 255) with no output.
问题原因:发送调教的代码失败。退出码为255,没有输出
解决方法:给post-commit加执行权限就行了chmod +x post-commit

156.1.nginx: [alert] could not open error log file: CreateFile() “logs/error.log” fail
ed (3: The system cannot find the path specified)
2017/04/05 14:36:33 [emerg] 828Id4860: CreateFile() “C:\Users\Administrator/conf/
nginx.conf” failed (2: The system cannot find the file specified)
nginx: configuration file C:\Users\Administrator/conf/nginx.conf test failed
问题原因:在windows下配置nginx时检出的语法错误。无法打开错误日志文件,创建错误日志文件失败。提示,系统无法找到这个特殊的路径。下面是另外一行错误,创建ngixn配置文件失败,系统无法找到特殊文件。nginx下的错误日志测试报错。
解决方法:这个问题明显是默认的nginx配置文件目录出错,在错误的配置文件上检测错误,错上加错。这个错误是因为环境变量,导致当前路径是c盘下的路径。解决方法是在安装目录使用相关的ngix命令
Id./nginx -c 你的conf文件位置
Id可以相对路径或者绝对路径

转载链接:https://blog.dugwang.com/?p=161


Tags:


本篇评论 —— 揽流光,涤眉霜,清露烈酒一口话苍茫。


    声明:参照站内规则,不文明言论将会删除,谢谢合作。


      最新评论




ABOUT ME

Blogger:袅袅牧童 | Arkin

Ido:PHP攻城狮

WeChat:nnmutong

Email:nnmutong@icloud.com

标签云