草庐IT

expected-exception

全部标签

PHP 错误警告 : Parameter 1 expected to be a reference

我“熟悉”PHP,我friend的网站因错误而崩溃:Warning:Parameter1toSome_function_name()expectedtobeareference,valuegivenin/.../public_html/includes/tng/tNG.class.phponline219第219行:$ret=call_user_func_array($callBackFunction,$tempParam);我不确定他的服务器上发生了什么,但是托管公司团队说了一些关于Joomla和PHP冲突的事情。我该如何解决? 最佳答案

php - 如何从 SELECT 查询中获取行数?给定的对象错误 : mysqli_affected_rows() expects parameter 1 to be mysqli,

我正在为表单进行服务器端验证。使用AJAX,表单将“用户名”输入字段中的值发送到我的PHP页面,然后检查该用户名是否已存在于数据库中。这是我的PHP代码:$result=mysqli_query($dblink,"SELECT*FROMusersWHERE`username`='$regname'")ordie(mysqli_error($dblink));echomysqli_affected_rows($result);*(目前我正在为mysqli_affected_rows做一个简单的回显,只是为了看看我的MySQL查询是否按预期工作)*我得到的错误是:Warning:mysql

php - 如何使用 .htaccess 将所有页面重定向到 https,但有异常(exception)?

我已经使用htaccess强制所有页面使用...重新路由到httpsRewriteEngineonRewriteBase/RewriteCond%{SERVER_PORT}80RewriteRule^(.*)$https://ourdomain.com/$1[R,L]有什么方法可以为ourdomain.com/videos&&ourdomain.com/blog撤销该规则,确保这些页面被迫放弃https并使用http? 最佳答案 您已经完成了使用RewriteCond将重写限制为端口80上的请求的部分。您不想为/videos和/bl

php - fatal error : Uncaught exception 'Parse\ParseException' with message in parse sdk

我使用以下代码获取数据库数据:require'autoload.php';$app_id='AAAAA';$rest_key='XXXXX';$master_key='RRRRR';useParse\ParseObject;useParse\ParseQuery;useParse\ParseACL;useParse\ParsePush;useParse\ParseUser;useParse\ParseInstallation;useParse\ParseException;useParse\ParseClient;useParse\ParseAnalytics;useParse\Par

php - C 中给出的警告 : fgetcsv() expects parameter 1 to be resource, bool 值:

我正在尝试使用fgetcsv()获取CSV,但出现如下错误:Warning:fgetcsv()expectsparameter1toberesource,booleangiveninC:..如果我var_dump($handle)确保输出是:Bool(False) 最佳答案 在尝试使用结果之前需要测试fopen是否成功:$handle=fopen($_FILES['filename']['tmp_name'],"r");if($handle){//Use$handle}else{die("Unabletoopenfile");}

xml - 解析器错误 : String not started expecting ' or " in php

您好,我正在尝试使用以下代码将XML文件转换为关联数组$xmlUrl='../products.xml';$xmlStr=file_get_contents($xmlUrl);$xmlObj=simplexml_load_string($xmlStr);print_r($xmlObj);exit;$arrXml=objectsIntoArray($xmlObj);和包含的product.xmlp750h3Plans:VodafoneUnlimitedCap$0$129$3096$0http://store.vodafone.com.au/Images/Upload/nokia-6260

php - 无法使用 gmail SMTP 在 Zend 中发送电子邮件。收到 fatal error : Uncaught exception 'Zend_Mail_Protocol_Exception' . 如何解决?

我正在尝试使用GmailSMTP发送电子邮件。以下是我的代码。$mail=newZend_Mail();$config=array('ssl'=>'ssl','port'=>'465','auth'=>'login','username'=>'username@gmail.com','password'=>'mypassword');$transport=newZend_Mail_Transport_Smtp('smtp.gmail.com',$config);$sendNow=$mail->setBodyHtml($message)->setFrom('username@gmail.

php - 使用 symfony 2.8 框架创建项目时出现 GuzzleHttp\Exception\RequestException

首先,我通过以下命令创建了symfony文件:php-r"file_put_contents('symfony',file_get_contents('https://symfony.com/installer'));"之后,我执行了以下命令来创建一个symfony项目:phpsymfonynewmy_project2.8结果:[GuzzleHttp\Exception\RequestException]cURL错误60:SSL证书问题:无法获取本地颁发者证书那么,这个问题有解决办法吗? 最佳答案 从这里下载cacert.pem文件

php - 未捕获异常 'Zend\ModuleManager\Exception\RuntimeException',消息为“模块(相册)无法初始化

我已经安装了运行良好的骨架应用程序,并且我已经创建了新模块。模块名称为“Album”。在创建模块尝试运行代码后,我收到了错误。这里发布我的代码:模块.phparray(__DIR__.'/autoload_classmap.php',),'Zend\Loader\StandardAutoloader'=>array('namespaces'=>array(__NAMESPACE__=>__DIR__.'/src/'.__NAMESPACE__,),),);}publicfunctiongetConfig(){returninclude__DIR__.'/config/module.co

php - 新手 : throw new exception - can we change exception name?

我正在尝试处理异常(exception)情况。所以我有类似的东西:如果发生不好的事情:thrownewCreateContactException($codigo,$result->msg);稍后,我会尝试,如果不行,捕获:try{createContact();}catch(CreateContactException$e){$error.='Anerroroccurredwiththecode:'.$e->getCode().'andmessage:'.$e->getMessage();}1)这行得通吗?我的意思是,这个getCode()和getMessage()与CreateCo