草庐IT

time_from

全部标签

php - 奏鸣曲管理员 - sonata_type_collection : select from the list of existing entities

我正在尝试使用PageHasImage桥接实体在Page和Image实体之间实现多对多关系。在PageAdmin中,我添加了如下字段:->add('galleryImages','sonata_type_collection',array('cascade_validation'=>false,'by_reference'=>false,'type_options'=>array('delete'=>false)),array('edit'=>'inline','inline'=>'table','sortable'=>'position','admin_code'=>'sonata.

php - Symfony/ Twig : How to get error Message from hidden fields

我在我的表单类型中定义了3个隐藏字段:publicfunctionbuildForm(FormBuilderInterface$builder,array$options){$builder->add('type','hidden',array())->add('number','hidden',array())->add('token','hidden',array());}当我发送我的表单时,我从我的Controller收到一个notValid错误,这是完全正确的。但是当我想在我的Twig模板中获取错误时,没有设置错误。{{dump(myForm.card.type.vars.er

php - Symfony2 : Get HTML from another file in controller

在我的Symfony2项目中,我想获取文件的HTML并将其放入Controller中的变量中。我有一个这样的Controller函数:publicfunctionmyControllerAction(){$htmlOtherFile='';return$this->render('@MyBundle/myTargetFile.html.twig',['htmlOtherFile'=>$htmlOtherFile]);}我想导入的html文件在我的View文件夹中:htmlOtherFile.html.twig如何将此文件的HTML放入我的$htmlOtherFile变量中?我已经尝试使

php - 将数据放入php ://input from command line

我有一个从php://input读取的小PHP脚本.使用我的命令行我可以运行脚本但我不知道如何“填充”php://input.我尝试使用phpfile.php但它填充了php://stdin不是php://input脚本可以总结为: 最佳答案 php://input仅适用于从网络服务器运行的脚本。当CLI脚本需要访问标准输入时,它们使用php://stdin,或者已经打开的流STDIN:或 关于php-将数据放入php://inputfromcommandline,我们在StackOve

PHP 执行时间超过 max_execution_time... 有时

我有一个PHP类,调用后将时间限制设置为60秒。这个类唯一的特别之处在于它使用了curl_multi_exec()。set_time_limit(60);ini_set('max_execution_time',60);问题是在Apache的/server-status页面下,这个页面和另一个使用单线程curl的页面有时会超过它们的max_execution_time并达到200秒!我错过了什么?有没有办法设置Apache终止运行时间超过90秒的脚本(甚至连接)? 最佳答案 来自themanual:Theset_time_limit

php - 绕过 max_execution_time?

我的服务器上有10秒,这对我想要做的事情来说还不够。它也被网络托管商禁用了。如果在执行了一定时间后,我执行了一个单独的PHP页面,这算在同一时间还是在该页面上重新开始?还有别的办法吗? 最佳答案 绕过最大执行时间的简单方法是像这样设置时间限制:设置时间限制(0); 关于php-绕过max_execution_time?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/7318825

php - 如何调试 "Maximum execution time" fatal error ?

我正在尝试在我的应用程序中使用Zend_acl。我遵循了“ZendFrameworkinaction”一书。我添加了这个助手:_auth=Zend_Auth::getInstance();$this->_acl=$options['acl'];//var_dump($this->_acl);die();}publicfunctioninit(){$this->_action=$this->getActionController();//addresourceforthiscontroller$controller=$this->_action->getRequest()->getCon

php - PHP 在启动过程的什么时候设置 REQUEST_TIME 变量

如PHPdocumentation中所述,$_SERVER超全局数组包含两个元素,REQUEST_TIME和REQUEST_TIME_FLOAT,它们都包含请求开始的时间戳,在不同的精度水平。我目前正在使用以下代码段来包含服务器在页面页脚中生成页面所花费的时间(以毫秒为单位):round((microtime(true)-$_SERVER['REQUEST_TIME_FLOAT'])*1000,2);它返回一个准确的值(无法真正检查,但它似乎与浏览器开始加载页面所需的时间相匹配),但我想知道$_SERVER['REQUEST_TIME']和$_SERVER['REQUEST_TIME_

PHP file_get_contents() : content truncated from 2147483648 to 2147483647 bytes

当我要创建2GB文件的zip文件时,如何找出问题。错误file_get_contents():contenttruncatedfrom2147483648to2147483647bytesFatalerror:Outofmemory(allocated2151677952)(triedtoallocate18446744071562067968bytes)in我正在使用专用服务器并且已经设置了memory_limit,max_execution_time,max_upload_filesize,max_post_size。但这对我不起作用。请检查我的代码并让我知道我做错了什么-创建新的

nginx - 错误 28105#0 : *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream

我无法使用php-fpm正确配置Nginx。当我得到任何php脚本时,我在浏览器中收到Nginx404Notfound错误:Filenotfound.在我的php-fpm日志中我得到:172.17.42.1-28/Apr/2015:09:15:15+0000"GET/index.php"404对于任何php脚本调用和Nginx日志,我得到:[error]28105#0:*1FastCGIsentinstderr:"Primaryscriptunknown"whilereadingresponseheaderfromupstream,client:127.0.0.1,server:loc