【发布时间】:2014-03-05 18:07:43
【问题描述】:
对不起,我来自巴西。
当我尝试在“prod”环境中使用我的系统时遇到此错误。 在“开发”环境中,一切正常。 在“prod”环境中并不总是给出错误。错误随机出现。
GET http://192.168.1.54/erp-zyx/web/publico/js/jquery/datepicker_custom.js 500 (Internal Server Error) 192.168.1.54/:631
在我的 base.html.twig 中:
<script type="text/javascript" src="{{path("datepicker_custom")}}"></script>
在我的控制器中:
/**
* @Route("/js/jquery/datepicker_custom.js", name="datepicker_custom")
*/
public function datepickerCustomAction()
{
$response = $this->render('ZuniAdminBundle:Plugin:datepicker_custom.js.twig', array());
$response->headers->set('Content-Type', 'text/javascript; charset=UTF-8');
return $response;
}
当我在 app.php $kernel = new AppKernel('prod', true); 中输入“true”时,“prod”环境一切正常。但我不能真正调试。
日志这样写:
[2014-03-05 10:20:32] request.INFO: Matched route "datepicker_custom" (parameters: "_controller": "Zuni\AdminBundle\Controller\PluginController::datepickerCustomAction", "_route": "datepicker_custom") [] []
[2014-03-05 10:20:33] request.CRITICAL: Uncaught PHP Exception RuntimeException: "Could not write new cache file to C:/xampp/htdocs/erp-zyx/app/cache/prod/jms_diextra/metadata/.cache.php." at C:\xampp\htdocs\erp-zyx\vendor\jms\metadata\src\Metadata\Cache\FileCache.php line 48 {"exception":"[object] (RuntimeException: Could not write new cache file to C:/xampp/htdocs/erp-zyx/app/cache/prod/jms_diextra/metadata/.cache.php. at C:\\xampp\\htdocs\\erp-zyx\\vendor\\jms\\metadata\\src\\Metadata\\Cache\\FileCache.php:48)"} []
我已经尽力了。我在服务器上渲染的四个 js 文件会发生这种情况。 谢谢!
【问题讨论】:
-
使用虚拟机而不是 windows 来测试网站。 WAMP(Windows Apache MySQL PHP)设置以怪异而臭名昭著,更不用说慢得要命了。
-
tinymce.min.js 也有同样的问题
-
@MarioJohnathan 你能解决吗?谢谢!
-
是的!我的 tinymce.min.js 中有
&lt;?和?&gt;,但我的服务器不喜欢它。我将它们更改为&lt;?和?&gt;,一切正常 -
初始代码为
pi:function(e,t){t?r.push("<?",e," ",t,"?>"):r.push("<?",e,"?>")
标签: php symfony twig production-environment