Symfony2:500开发模式下资产生成文件的内部错误

时间:2013-11-26 09:15:32

标签: symfony assetic

我在我的Symfony2项目上使用assetic,当我将项目放在新的服务器环境中时,我在开发环境中的CSS和JS生成的文件顶部有以下500内部服务器错误。似乎assetic无法访问临时目录来生成文件。

[exception] 500 | Internal Server Error | ErrorException
[message] Warning: file_put_contents(): Filename cannot be empty in /Users/jo/Developpement/coV2/Symfony/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/BaseCompressorFilter.php line 92
[1] ErrorException: Warning: file_put_contents(): Filename cannot be empty in /Users/jo/Developpement/coV2/Symfony/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/BaseCompressorFilter.php line 92
                at n/a
                    in /Users/jo/Developpement/coV2/Symfony/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/BaseCompressorFilter.php line 92

                at Symfony\Component\HttpKernel\Debug\ErrorHandler->handle('2', 'file_put_contents(): Filename cannot be empty', '/Users/jo/Developpement/coV2/Symfony/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/BaseCompressorFilter.php', '92', array('content' => '/*!

BaseCompressorFilter类的第92行是此代码的最后一行:

    $tempDir = realpath(sys_get_temp_dir());
    $input = tempnam($tempDir, 'YUI-IN-');
    $output = tempnam($tempDir, 'YUI-OUT-');
    file_put_contents($input, $content);

$ tempDir没问题,但$ input为空。

有什么想法吗?

0 个答案:

没有答案