草庐IT

a_function_that_may_fail

全部标签

nginx - CentOS 6.6 与 Nginx 1.6.2 - 突然无法重启 nginx - nginx : [emerg] open() “/usr/share/nginx/on” failed (13: Permission denied)

这是一个新安装,之前nginx正常启动和停止。我相信这个错误是在启用成功测试(nginx-t)的服务器block之后出现的。然后我尝试重新启动nginx并收到此错误:nginx:[emerg]open()"/usr/share/nginx/on"失败(13:权限被拒绝)在尝试重新启动之前文件“on”不存在。它刚刚创建并且是空的。当我重新启动php-fmp(成功)然后尝试重新启动nginx时,错误更改为:nginx:[emerg]open()"/var/run/nginx.pid"失败(13:权限被拒绝)nginx:配置文件/etc/nginx/nginx.conf测试失败但同样,当我运

php - fatal error : Call to undefined function asset() in C:\wamp\www\laravel-master\app\views\hello. PHP

我想学习laravel框架。我可以在我的网络服务器(Wamp)中安装laravel,我得到了一些学习它的教程,但是当我尝试将样式添加到hello.php文件中的“h1”标签时,位于该路径中:(“C:\wamp\www\laravel-master\app\views\hello.php")通过asset()函数,出现上述错误。请帮我找出问题所在。这是hello.php代码:body{margin:0;font-family:'Lato',sans-serif;text-align:center;color:#999;}.welcome{width:300px;height:200px;

php - GAPI : Failed to authenticate user. 永久修复 PHP

关闭。这个问题需要debuggingdetails.它目前不接受答案。编辑问题以包含desiredbehavior,aspecificproblemorerror,andtheshortestcodenecessarytoreproducetheproblem.这将有助于其他人回答问题。关闭7年前。Improvethisquestion我正在尝试从GAPI中获取内容,它有时可以正常工作,但有时会抛出此错误:ExceptionGAPI:Failedtoauthenticateuser.Error:"https://developers.google.com/accounts/docs/A

php - <b> fatal error </b> : Uncaught exception 'Exception' with message 'Failed to connect to api.twitter.com port 443: Connection timed out'

我正在开发一个Codeigniter项目,在该项目中我使用twitterapi库来获取twitter数据。在我更改服务器之前它工作得很好,但是在更改服务器之后它产生了以下错误。我不知道问题所在。Fatalerror:Uncaughtexception'Exception'withmessage'Failedtoconnecttoapi.twitter.comport443:Connectiontimedout'in/my/project/path/myProject/application/ws/libraries/TwitterAPIExchange.php:297Stacktrac

php - 未捕获的异常 'ImagickException',消息为 'Compare images failed'

这是我第一次使用ImageMagick,我正在做一个小测试,看看它是否真的能满足我的要求;但是,我收到错误“比较图像失败”。很可能我做错了什么,因为我真的不知道Imagick是如何工作的。我对其他建议持开放态度,我只想比较两个几乎没有变化的图像。我的测试代码如下所示:readImage("export/image1.jpg");$image2->readImage("export/image2.jpg");$result=$image1->compareImages($image2,1);$result[0]->setimageFormat("jpg");echo$result[1].

php - fatal error : Call to undefined function mb_strtolower(): enable mbstring on linux EC2

我已经通过sudoyuminstallphp-mbstring在我的带有php5.6.17的linuxEC2实例上安装了mbstring。我怎样才能启用它? 最佳答案 需要使用yuminstallphp56-mbstring。安装后,无需配置,只需重启httpd服务即可 关于php-fatalerror:Calltoundefinedfunctionmb_strtolower():enablembstringonlinuxEC2,我们在StackOverflow上找到一个类似的问题:

PHPUnit 错误 "Failed to open stream: No such file or directory"

我刚刚安装了PHPUnitTesting,但出于某种原因它无法读取我的文件。我确信它在正确的路径中,但为什么PHPUnit找不到它?这是我的示例代码:函数.php这是要测试的代码和文件:函数测试.phpassertEquals(2,$result);}}?>我该怎么做才能让它发挥作用并通过测试? 最佳答案 您应该能够使用__DIR__。"/data/functions.php"在你的include语句中(这是前后两个下划线)。我在我的测试环境中做了一个快速测试,没有任何问题。__DIR__魔术常量为您提供了您正在运行的测试文件的完整

php - 在 wordpress 的子主题 functions.php 中禁用主题功能

我在wordpress中遇到了我的主题问题,它在我的主题上显示了它自己的og:meta描述,因此由于allinoneseo插件,它被复制了。我想从主题中禁用那些,但我不知道如何,所以我设法在php文件中找到触发它显示在网站上的函数,但我不知道如何从中禁用它functions.php或我的子主题,因此更新时它不会被覆盖。有问题的功能如下//OpenGraphMetafunctionaurum_wp_head_open_graph_meta(){global$post;//Onlyshowifopengraphmetaisallowedif(!apply_filters('aurum_op

php - Twig_Error_Syntax : Unknown "template_from_string" function. 函数已过时?

我记得在composer更新后我遇到了这个错误,但之前它运行良好,并且在比较包版本时我没有发现差异。我在模板中以这种方式使用它:{{include(template_from_string(page.body))}}其中“页面”是来自Controller的实体对象。当前版本是:symfony/symfonyv2.8.15twig/extensionsv1.4.1twig/twigv1.30.0同样在config.yml中:twig:debug:"%kernel.debug%"strict_variables:"%kernel.debug%"form_themes:-'AppBundle

php - Doctrine2 错误 "Expected known function, got ' COUNT'"when in order by clause

我正在使用doctrine2我尝试根据售出的门票数量获取“事件”的数量$manager=$this->getDoctrine()->getManager();$builder=$manager->createQueryBuilder();return$builder->select('e')->from('AppBundle:Event','e')->leftJoin('e.tickets','t')->orderBy('COUNT(t)')->groupBy('e.id')->setMaxResults(10)->getQuery()->getResult();这会产生错误[Synt