Notice: Undefined variable 的解决方法
- font size decrease font size increase font size
这是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.0007 | 415520 | {main}( ) | .../index.php:0 |
2 | 0.0683 | 4720824 | Joomla\CMS\Application\SiteApplication->execute( ) | .../index.php:49 |
3 | 0.0683 | 4720824 | Joomla\CMS\Application\SiteApplication->doExecute( ) | .../CMSApplication.php:196 |
4 | 0.2558 | 12449120 | Joomla\CMS\Application\SiteApplication->dispatch( ) | .../SiteApplication.php:233 |
5 | 0.2564 | 12473640 | Joomla\CMS\Component\ComponentHelper::renderComponent( ) | .../SiteApplication.php:194 |
6 | 0.2570 | 12528968 | Joomla\CMS\Component\ComponentHelper::executeComponent( ) | .../ComponentHelper.php:377 |
7 | 0.2573 | 12557792 | require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ) | .../ComponentHelper.php:402 |
8 | 0.2651 | 12993200 | K2ControllerItem->execute( ) | .../k2.php:64 |
9 | 0.2651 | 12993200 | K2ControllerItem->display( ) | .../BaseController.php:710 |
10 | 0.2747 | 13718400 | K2ControllerItem->display( ) | .../item.php:78 |
11 | 0.2747 | 13718400 | K2ControllerItem->display( ) | .../controller.php:19 |
12 | 0.2787 | 14114768 | Joomla\CMS\Cache\Controller\ViewController->get( ) | .../BaseController.php:663 |
13 | 0.2802 | 14135136 | K2ViewItem->display( ) | .../ViewController.php:102 |
14 | 0.3893 | 17067752 | K2ViewItem->display( ) | .../view.html.php:742 |
15 | 0.3893 | 17067752 | K2ViewItem->loadTemplate( ) | .../HtmlView.php:230 |
16 | 0.3933 | 17247952 | include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ) | .../HtmlView.php:701 |
- Published in 主机
- Read 3780 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.0007 | 415520 | {main}( ) | .../index.php:0 |
2 | 0.0683 | 4720824 | Joomla\CMS\Application\SiteApplication->execute( ) | .../index.php:49 |
3 | 0.0683 | 4720824 | Joomla\CMS\Application\SiteApplication->doExecute( ) | .../CMSApplication.php:196 |
4 | 0.2558 | 12449120 | Joomla\CMS\Application\SiteApplication->dispatch( ) | .../SiteApplication.php:233 |
5 | 0.2564 | 12473640 | Joomla\CMS\Component\ComponentHelper::renderComponent( ) | .../SiteApplication.php:194 |
6 | 0.2570 | 12528968 | Joomla\CMS\Component\ComponentHelper::executeComponent( ) | .../ComponentHelper.php:377 |
7 | 0.2573 | 12557792 | require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ) | .../ComponentHelper.php:402 |
8 | 0.2651 | 12993200 | K2ControllerItem->execute( ) | .../k2.php:64 |
9 | 0.2651 | 12993200 | K2ControllerItem->display( ) | .../BaseController.php:710 |
10 | 0.2747 | 13718400 | K2ControllerItem->display( ) | .../item.php:78 |
11 | 0.2747 | 13718400 | K2ControllerItem->display( ) | .../controller.php:19 |
12 | 0.2787 | 14114768 | Joomla\CMS\Cache\Controller\ViewController->get( ) | .../BaseController.php:663 |
13 | 0.2802 | 14135136 | K2ViewItem->display( ) | .../ViewController.php:102 |
14 | 0.3893 | 17067752 | K2ViewItem->display( ) | .../view.html.php:742 |
15 | 0.3893 | 17067752 | K2ViewItem->loadTemplate( ) | .../HtmlView.php:230 |
16 | 0.3933 | 17247952 | include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ) | .../HtmlView.php:701 |