草庐IT

PhpStorm - 如何检测 PHP 错误 "Non-static method should not be called statically"?

在PHP中,静态方法既可以在静态方法中使用,也可以在非静态方法中使用,非静态方法只能在非静态方法中使用。这就是静态调用动态方法会生成E_STRICT错误的原因。例如:bar();//Staticcallonanon-staticmethod//PHPError"Strictstandards:Non-staticmethodshouldnotbecalledstatically"//ERRORNOTDETECTEDBYPHPSTORM!echoExample::foo();最后一行将生成此PHP错误(这是逻辑):我目前正在开发一个大型PHP应用程序,该应用程序在某些PHP文件中静态调用

php - 上传未保存的文件时为 "Trying to get property of non-object"

我有一个模型具有使用OctoberCMS的system_files的文件关系。public$attachOne=['return_file'=>['System\Models\File','public'=>false,'delete'=>true]];在fields.yaml中我有表格return_file:label:AttachFiletype:fileuploadmode:filespan:right现在,在保存之前或之后,我想将图像从其目录移动到我的插件中的自定义目录。afterSave()似乎没有检索文件路径来移动它。但是在system_files中我看到在MySQLwor

php - fatal error : Call to a member function close() on a non-object. MySQLi 问题

当我上传到实时服务器时出现以下错误。它在本地主机上工作正常,我认为这很奇怪。Fatalerror:Calltoamemberfunctionclose()onanon-object....它引用的行$stmt->close();与数据库的连接$connection=newmysqli($MYSQL_HOST,$MYSQL_USER,$MYSQL_PASS,$DB)ordie(mysqli_error($connection));类本身。functiongetTimes(){//thismethodjustpullstheresultsofthequeryandreturnsthemas

php - Symfony 2/存储库 : Error: __clone method called on non-object

我刚开始使用Symfony,但我不明白为什么在存储库中创建自定义函数时会出现此错误。我的实体Category.php:name;}/***Getid**@returninteger*/publicfunctiongetId(){return$this->id;}/***Setname**@paramstring$name*@returnCategory*/publicfunctionsetName($name){$this->name=$name;return$this;}/***Getname**@returnstring*/publicfunctiongetName(){retur

php - 拉维尔 "File Upload Error Call to a member function getClientOriginalName() on a non-object"

全部。我正在尝试学习Laravel,并且正在努力上传图片。我收到以下错误:“在非对象上调用成员函数getClientOriginalName()”我正在使用这些包:"anahkiasen/former":"dev-master","intervention/image":"dev-master","intervention/imagecache":"2.*"使用SO后,我已验证以下内容不会导致上述错误:表单上的多部分/表单数据存在上传文件数据PHP.ini的max_filesize比这个小测试文件的大小要大得多我的表格是:UploadImage产生错误的代码是:$image=Input

php - 错误 : You made a reference to a non-existent script @php artisan package:discover

我在laravel项目中运行composerdump-autoload时出错composerdump-autoloadGeneratingautoloadfiles>Illuminate\Foundation\ComposerScripts::postAutoloadDumpYoumadeareferencetoanon-existentscript@phpartisanpackage:discover然后执行phpartisanpackage:discover返回DiscoveredPackage:barryvdh/laravel-ide-helperDiscoveredPackag

php - fatal error : Call to a member function check_capabilities() on a non-object

我在functions.php中编写了这段代码,以向我的主题个性化添加一个部分。但是当我想打开“localhost/wordpress/wp-admin/customize.php?theme=eye-theme”来查看我的结果时,我看到了这个错误:Fatalerror:Calltoamemberfunctioncheck_capabilities()onanon-objectinC:\xampp\htdocs\xampp\wordpress\wp-includes\class-wp-customize-control.phponline233这是我的functions.php:add

php - 第 6 行的 fatal error : Call to a member function get() on a non-object in C:\wamp\www\ci\application\models\site_model. php

你好,我刚看了Nettuts上的第一个/第1天截屏视频“来自scracth的CodeIgniter”,我已经遇到了一个我不明白的错误。这是屏幕截图http://i39.tinypic.com/14mtc0n.jpg我的models\site_model.php中的代码和截屏是一样的models\site_model.phpclassSite_modelextendsCI_Model{functiongetAll(){$q=$this->db->get('test');if($q->num_rows()>0){foreach($q->result()as$row){$data[]=$ro

php - CodeIgniter 自定义库错误 : Call to a member function on a non-object

我正在尝试构建一个自定义库,其中包含可在整个站点中使用的功能。在/application/libraries我创建了一个新文件CustomFuncts:ci=&get_instance();}/***@briefcheckCookie**Checksforapreviouscookie,andifexists:*@liLoadsuserdetailstoCISessionobject.*@liRedirectstothecorrespondingpage.**/publicfunctionverificaCookie(){$this->ci->load->view('index');}

php - 警告 : mail() [function. 邮件] : SMTP server response: 553 We do not relay non-local mail, 抱歉

以下脚本使用mail函数发送电子邮件。但我无法发送电子邮件。单击submit后会显示:Warning:mail()[function.mail]:SMTPserverresponse:553Wedonotrelaynon-localmail,sorry.inE:\xampp\htdocs\feedback.phponline19mailsentsuccessfully脚本Emailofsender:Subject:Enteryourfeedbackhere:";}?>我正在使用Apache作为php服务器还要说明为什么我们必须编写$subject、$message即在邮件参数中使用$符