草庐IT

call_once

全部标签

php - require_once : failed to open stream: Permission denied(lampp)

我需要帮助解决htdocs文件夹中的权限错误,因为我需要更改它们以首先添加文件夹。这是我的init.php文件:我尝试通过`包含它当我运行我的index.php文件时,我得到这个错误:Warning:require_once(../../htdocs/PHP-Wizard/helpers/system_helper.php):failedtoopenstream:Permissiondeniedin/opt/lampp/htdocs/PHP-Wizard/core/init.phponline9Fatalerror:require_once():Failedopeningrequire

php - Facebook 通知 API : "This method must be called with an app access_token"

我正在尝试使用GraphAPIExplorer从我的应用程序发送Facebook通知。所以我选择了我的应用程序,POST,并在/之后输入了这个字符串11093774316/notifications?access_token=430xxxxxx156|HU0ygMtxxxxxxxxxxxxikVKg&template=Hello&href=index.php访问字符串是我在“访问token调试器”上得到的,我检查它是否正常。但是,我收到此错误消息:{"error":{"message":"(#15)Thismethodmustbecalledwithanappaccess_token.

php - 如何在 PHP 中列出 require_once() 的搜索路径?

我们以前都见过这个错误:Warning:require_once(test/blah.inc)[function.require-once]:failedtoopenstream:Nosuchfileordirectoryin/home/narf/narf.inconline3Fatalerror:require_once()[function.require]:Failedopeningrequired'test/blah.inc'(include_path='.:/usr/lib64/php:/usr/lib/php:/home/narf/inc:/home3/narf/php:/

php - 类上下文中的 call_user_func(定义了 $this)

有没有一种方法可以在对象的上下文中执行PHP5.3中的闭包?classTest{public$name='John';functiongreet(){eval('echo"Hello,".$this->name;');call_user_func(function(){echo"Goodbye,".$this->name;});}}$c=newTest;$c->greet();eval()可以正常工作,但是call_user_func将无法访问$this。(不在对象上下文中时使用$this)。我现在将“$this”作为参数传递给闭包,但这并不是我所需要的。

php - fatal error : Call to undefined function validation_errors() using codeIgniter

fatalerror:使用codeIgniter调用未定义函数validation_errors()这是我的comments.phpViewNameEmailComment这是我的news_model.phpload->database();}//setcommentpublicfunctionset_comment(){$this->load->helper('url');$this->load->helper('date');$data_c=array('comment_name'=>$this->input->post('comment_name'),'comment_email

PHP array_walk require_once

我只是想知道是否有人知道为什么我不能使用require_once作为array_walk的回调。我可以将它包含在一个匿名函数中并运行它,但它给出了一个无效的回调错误:$includes=array('file1.php','file2.php','file3.php');array_walk($includes,'require_once'); 最佳答案 require_once不是一个PHP函数,而是一个控制结构。 关于PHParray_walkrequire_once,我们在Stac

php - call_user_func() 和 $var() 之间有区别吗?

call_user_func()和它的语法糖版本之间有什么区别吗...//Globalfunction$a='max';echocall_user_func($a,1,2);//2echo$a(1,2);//2//ClassmethodclassA{publicfunctionb(){return__CLASS__;}staticfunctionc(){return'Iamstatic!';}}$a=newA;$b='b';echocall_user_func(array($a,$b));//Aecho$a->$b();//A//Staticclassmethod$c='c';echo

php - 什么设置导致区分大小写的 require_once 路径?

在我的本地环境中,我需要一次publiccontroller.php,它将加载publicController.php不幸的是,当我在HostGator上投入生产时,它会失败,因为它没有松散地要求/包含文件。这是PHP还是Apache的东西?我需要镜像我的环境,所以我想更改我的本地设置以匹配我的生产服务器。 最佳答案 文件系统区分大小写不是PHP设置,而是特定于操作系统和文件系统。Windows文件系统往往不区分大小写,而大多数其他操作系统更喜欢区分大小写的文件系统。由于您不一定能预测您的代码将来会在什么操作系统上运行,因此建议始终

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

这个问题在这里已经有了答案:Whattodowithmysqliproblems?Errorslikemysqli_fetch_array():Argument#1mustbeoftypemysqli_resultandsuch(1个回答)关闭4个月前。我收到此文本的错误:(抱歉我的英语不好,我来自德国!)错误:fatalerror:在第44行/users/ftf/www/ccache.php中的非对象上调用成员函数bind_param()部分代码来自ccache.php//NeuesDatenbank-Objekterzeugen$db=@newmysqli('localhost',

php - 如何允许 require_once() 到 wordpress 中的 php 文件

我有一个由wordpress制作的网站,我制作了一些我想执行的php文件,出于某种原因我需要require_once(/wp-includes/class-phpass.php)但我得到了Failedopeningrequired错误,根文件夹中有一个htaccess文件,它不存在于wp-includes文件夹中htaccess包含这个:#BEGINWordPressRewriteEngineOnRewriteBase/RewriteRule^index\.php$-[L]RewriteCond%{REQUEST_FILENAME}!-fRewriteCond%{REQUEST_FIL