草庐IT

the_menu

全部标签

php - "localhost is currently unable to handle the request"

我刚刚将我的laravel项目从我的Windows服务器移动到我的Ubuntu服务器。当我尝试加载应用程序时,它说此页面无法正常工作。关于这件事,我想请你帮忙。谢谢 最佳答案 对我来说,这是存储目录的权限问题递归设置存储目录权限为0755 关于php-"localhostiscurrentlyunabletohandletherequest",我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/quest

php - Apache + PHP : how to change the value of $_SERVER ['SERVER_NAME' ] in apache?

例如,我有mysite.com和beta.mysite.com。两者都使用virtualHost指令指向同一个索引文件。我将在apacheconf中做什么,以便当我访问$_SERVER['SERVER_NAME']时,该值仍然是mysite.com?这应该是灵活的,只有beta会被删除。 最佳答案 也许您可以在VirtualHost指令中使用ServerAlias,并且只使用一个VirtualHost指令:ServerNamemysite.comServerAliasbeta.mysite.com...

php - Zend 框架 : How do I change the default layout script to something other than layout. phtml?

我想将我的默认布局文件命名为layout.phtml以外的名称,因为它并没有真正描述它是什么类型的布局。我怎样才能做到这一点?谢谢! 最佳答案 在您的Bootstrap.php文件中,您可以执行如下操作:protectedfunction_initLayoutName(){//usesitelayout.phtmlasthemainlayoutfileZend_Layout::getMvcInstance()->setLayout('sitelayout');}如果你想为不同的模块使用不同的布局,你需要在Bootstrap中注册一个

PHP : Detect Content-Type of the page

在PHP中,我们可以通过以下方式设置内容类型:header('Content-Type:text/plain');但是如果我处理一个需要显示错误消息的PHP类,错误消息的格式是根据内容类型显示的,例如如果页面是text/html,则显示HTML格式的错误信息;否则,显示纯文本错误消息。是否有任何函数/片段可用于检测页面内容类型?注意:鉴于PHP类文件是通过require_once()“附加”到页面的更新:根据@Tamil的回答,我进行了一个简短的测试:它只返回text/x-php。但我希望结果会返回text/plain。 最佳答案

php - 严重性 : 8192 Message: Methods with the same name as their class will not be constructors in a future version of PHP;

严重性:8192消息:在未来的PHP版本中,与类同名的方法将不再是构造函数;CI_Pagination有一个已弃用的构造函数文件名:libraries/Pagination.php行号:27classCI_Pagination{var$base_url='';//Thepagewearelinkingtovar$total_rows='';//Totalnumberofitems(databaseresults)var$per_page=10;//Maxnumberofitemsyouwantshownperpagevar$num_links=2;//Numberof"digit"li

php curl 错误 : Failure when receiving data from the peer

我有一个基本的Curl脚本,它基本上在远程服务器上执行脚本。从大约6个月开始,我工作正常。昨天它停止工作,并返回以下错误。Curlerror:Failurewhenreceivingdatafromthepeer想知道是否有人知道curl在什么情况下会返回这样的错误? 最佳答案 当处理curl问题时,再次运行它:curl_setopt($ch,CURLOPT_VERBOSE,true);curl_setopt($ch,CURLOPT_STDERR,fopen('php://output','w'));通常准确的错误信息在某处。已修复

php - 无法使用字符串替换更改 the_content 中的 <p> 标记

我正在努力获得一个简单的字符串替换以在wordpressthe_content函数中工作。';$replace='';$newphrase=str_replace($find,$replace,$phrase);echo$newphrase;?>它似乎在呼应仍然。而不是 最佳答案 您需要使用apply_filters('the_content')让Wordpress的段落换行。';echostr_replace('',$replace,$phrase);?>请参阅the_content的法典条目.它在替代用法部分。

php - 获取错误 "Below is a rendering of the page up to the first error."

我正在使用XMLWriter创建xml。下面是我的代码,它运行良好。openMemory();$writer->startDocument('1.0');$writer->setIndent(4);$writer->startElement('epp');$writer->startElement("command");$writer->startElement("login");$writer->writeElement('clID','hello');//username$writer->writeElement('pw','abcdefg');//password$writer-

php - Eloquent fatal error : argument passed not the right instance

我正在使用Slim和Eloquent在PHP中构建端点系统,如概述here.在我的本地开发人员中运行它时,下面的代码失败并出现基于方法预期的fatalerror//LoadEloquent$connFactory=new\Illuminate\Database\Connectors\ConnectionFactory();$conn=$connFactory->make($settings);$resolver=new\Illuminate\Database\ConnectionResolver();$resolver->addConnection('default',$conn);$

php - gmmktime() : You should be using the time() function instead

出现以下错误的原因是什么?如何解决问题?gmmktime():Youshouldbeusingthetime()functioninstead第90行的问题:89date_default_timezone_set("GMT");90$time=gmmktime(); 最佳答案 gmmktime()内部使用mktime(),在不带参数调用时抛出E_STRICT通知,因此使用time()代替功能。 关于php-gmmktime():Youshouldbeusingthetime()funct