草庐IT

report_callback_exception

全部标签

php - 为生产覆盖 Kohana_Exception::_handler() - 3.3

我正在使用Kohana3.3并且我阅读了这个forumpost.它说,为了防止向最终用户显示堆栈跟踪,我需要覆盖Kohana_Exception::_handler()以对向上渗透的错误做一些不同的事情。这是否意味着覆盖Kohana_Exception并添加以下函数?publicstaticfunction_handler(Exception$e){try{//LogtheexceptionKohana_Exception::log($e);//Generatetheresponse//insteadofbelowline://$response=Kohana_Exception::r

php - 将 preg_replace() 替换为 preg_replace_callback()

这个问题在这里已经有了答案:Replacepreg_replace()emodifierwithpreg_replace_callback(3个答案)关闭3年前。$source=preg_replace('/&#(\d+);/me',"utf8_encode(chr(\\1))",$source);上面的代码给出了弃用的警告。Deprecated:preg_replace():The/emodifierisdeprecated,usepreg_replace_callbackinsteadin如何将preg_replace()替换为preg_replace_callback()?

php - 未捕获的异常 'Exception' 消息为“DateTime::__construct():

我在输出在我的PHP文件中创建的日期时遇到问题。我一直在关注如何制作一个真正的Basic-CMS平台的教程,以帮助我了解databases和PHP的一些基础知识,一切都已经完成一切顺利,直到我尝试输出页面的创建日期。这是我得到的错误Fatalerror:Uncaughtexception'Exception'withmessage'DateTime::__construct():Itisnotsafetorelyonthesystem'stimezonesettings.Youare*required*tousethedate.timezonesettingorthedate_defa

php - 为什么 Exception 不是 Throwable 的实例?

我认为在所有编程语言中,Exception类都是Throwable接口(interface)的实例。看看下面的代码,它显示Exception不是php中Throwable的实例。try{thrownewInvalidArgumentException("errormessage");}catch(InvalidArgumentException$e){if($einstanceofException){echo'$eisexception';//thislinegetsexecuted}if($einstanceofThrowable){echo'$eisthrowable';//bu

PHP 和 FPDI/FPDF : Fatal error: Uncaught Exception: FPDF error: Incorrect output destination

我有一个PDF文件,我想用FDI/FPDF添加一个新页面Fatalerror:UncaughtException:FPDFerror:Incorrectoutputdestination:outfiles/111111.pdfinC:\wamp\www\pdf\fpdi\fpdf.phponline271(!)Exception:FPDFerror:Incorrectoutputdestination:outfiles/111111.pdfinC:\wamp\www\pdf\fpdi\fpdf.phponline271require_once('fpdi/fpdf.php');requ

php - cURL sftp 公钥认证失败 "Callback Error"

我有一些php代码可以很好地使用cURL将文件上传到仅使用用户和密码ftp的主机,现在我必须上传到一个只允许公钥auth的服务器并收到错误:“*SSHpublickey认证失败:回调返回错误”我遇到了key问题,因为它们的格式不正确,但后来将它们放入正确的单行格式中,这就停止了“不是base64编码”的错误。我在网上找不到有关此回调错误的太多帮助。我的代码如下。$ch=curl_init();curl_setopt($ch,CURLOPT_VERBOSE,TRUE);curl_setopt($ch,CURLOPT_URL,'sftp://user:@12.12.12.12:22/tes

php - 更新到 PHP 7 后出现 CodeIgniter CI_Exceptions::show_exception 错误

我在PHP5.6中使用CodeIgniter3.0.0。昨天我更新到PHP7并开始出现以下错误:-UncaughtTypeError:Argument1passedtoCI_Exceptions::show_exception()mustbeaninstanceofException,instanceofErrorgiven,calledin/my/file/path/app/system/core/Common.phponline658anddefinedin/my/file/path/hgx_portal/app/system/core/Exceptions.php:190Stac

php - fatal error : Uncaught exception 'Exception' in PHPExcel classes

谁能告诉我,为什么从PHPExcel类中抛出以下错误Fatalerror:Uncaughtexception'Exception'withmessage'Couldnotclosezipfile/var/www/mydomain/myexcel.xlsx.'in/var/www/mydomain/Classes/PHPExcel/Writer/Excel2007.php:400Stacktrace:#0/var/www/mydomain/myexcel.php(173):PHPExcel_Writer_Excel2007->save('/var/www/mydomain...')#1{

php - Kohana_Exception [ 0 ]:需要有效的 cookie 盐。请设置 Cookie::$salt

我正在学习本教程(http://kowsercse.com/2011/09/04/kohana-tutorial-beginners/)并遇到此错误消息:Kohana_Exception[0]:Avalidcookiesaltisrequired.PleasesetCookie::$salt.我是一个n00b,甚至不知道在应用程序中的哪里寻找Cookie::$salt。 最佳答案 您必须提供盐,您可以在officialdocumentation中看到//bootstrap.phpCookie::$salt='foobar';我强烈推

php - Zend_Controller_Router_Exception : "xyz" is not specified

我当前的ZendFramework应用程序有问题。在我的Bootstrap中,我注册了这些路由:protectedfunction_initRouter(){$this->bootstrap("FrontController");$frontController=$this->getResource("FrontController");$route=newZend_Controller_Router_Route(":module/:id",array("controller"=>"index","action"=>"index"),array("id"=>"\d+"));$front