Notice: Undefined variable 的解决方法
- font size decrease font size increase font size
- Print Email
这是PHP警告信息,是由于未定义变量引起的。
比如:你未设置变量,却在php中用echo $varstr 了,就会出显这种情况,
解决方法:
修改php.ini
将: error_reporting = E_ALL
修改为:error_reporting = E_ALL & ~E_NOTICE
如果什么错误都不想让显示,直接修改:
display_errors = Off
如果你没有php.ini的修改权限,可在php头部加入
ini_set("error_reporting","E_ALL & ~E_NOTICE");
即可
Last modified onSaturday, 05 January 2013 13:21
( ! ) Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 169 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0009 | 412856 | {main}( ) | .../index.php:0 |
2 | 0.1181 | 4262968 | Joomla\CMS\Application\SiteApplication->execute( ) | .../index.php:49 |
3 | 0.1181 | 4262968 | Joomla\CMS\Application\SiteApplication->doExecute( ) | .../CMSApplication.php:196 |
4 | 0.4095 | 11453936 | Joomla\CMS\Application\SiteApplication->dispatch( ) | .../SiteApplication.php:233 |
5 | 0.4106 | 11478376 | Joomla\CMS\Component\ComponentHelper::renderComponent( ) | .../SiteApplication.php:194 |
6 | 0.4118 | 11533704 | Joomla\CMS\Component\ComponentHelper::executeComponent( ) | .../ComponentHelper.php:377 |
7 | 0.4122 | 11561104 | require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ) | .../ComponentHelper.php:402 |
8 | 0.4245 | 11960736 | K2ControllerItem->execute( ) | .../k2.php:64 |
9 | 0.4245 | 11960736 | K2ControllerItem->display( ) | .../BaseController.php:710 |
10 | 0.4388 | 12611440 | K2ControllerItem->display( ) | .../item.php:78 |
11 | 0.4388 | 12611440 | K2ControllerItem->display( ) | .../controller.php:19 |
12 | 0.4453 | 12982480 | Joomla\CMS\Cache\Controller\ViewController->get( ) | .../BaseController.php:663 |
13 | 0.4471 | 13002848 | K2ViewItem->display( ) | .../ViewController.php:102 |
14 | 0.5379 | 15801896 | K2ViewItem->display( ) | .../view.html.php:742 |
15 | 0.5379 | 15801896 | K2ViewItem->loadTemplate( ) | .../HtmlView.php:230 |
16 | 0.5404 | 15974832 | include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ) | .../HtmlView.php:701 |
- Published in 主机
- Read 3777 times
( ! ) Notice: Only variables should be assigned by reference in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 478 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0009 | 412856 | {main}( ) | .../index.php:0 |
2 | 0.1181 | 4262968 | Joomla\CMS\Application\SiteApplication->execute( ) | .../index.php:49 |
3 | 0.1181 | 4262968 | Joomla\CMS\Application\SiteApplication->doExecute( ) | .../CMSApplication.php:196 |
4 | 0.4095 | 11453936 | Joomla\CMS\Application\SiteApplication->dispatch( ) | .../SiteApplication.php:233 |
5 | 0.4106 | 11478376 | Joomla\CMS\Component\ComponentHelper::renderComponent( ) | .../SiteApplication.php:194 |
6 | 0.4118 | 11533704 | Joomla\CMS\Component\ComponentHelper::executeComponent( ) | .../ComponentHelper.php:377 |
7 | 0.4122 | 11561104 | require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ) | .../ComponentHelper.php:402 |
8 | 0.4245 | 11960736 | K2ControllerItem->execute( ) | .../k2.php:64 |
9 | 0.4245 | 11960736 | K2ControllerItem->display( ) | .../BaseController.php:710 |
10 | 0.4388 | 12611440 | K2ControllerItem->display( ) | .../item.php:78 |
11 | 0.4388 | 12611440 | K2ControllerItem->display( ) | .../controller.php:19 |
12 | 0.4453 | 12982480 | Joomla\CMS\Cache\Controller\ViewController->get( ) | .../BaseController.php:663 |
13 | 0.4471 | 13002848 | K2ViewItem->display( ) | .../ViewController.php:102 |
14 | 0.5379 | 15801896 | K2ViewItem->display( ) | .../view.html.php:742 |
15 | 0.5379 | 15801896 | K2ViewItem->loadTemplate( ) | .../HtmlView.php:230 |
16 | 0.5404 | 15974832 | include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ) | .../HtmlView.php:701 |