svn 导出使我的页面空白
我正在将 LAMP 与 CodeIgniter 用于我的一个项目;版本由SVN控制。每次我执行 svn export file:///svnrepo/project/trunk/www 时。 --force 当在www目录中然后重新加载网页时,它会变成空白。
该网站仅在我执行service httpd restart
(使用 CentOS 5)后才显示。
我希望将来能够使用 Phing 构建脚本执行 svn 导出,并且我不想每次构建时都必须获得 root 权限并重新启动 apache。
我遇到的问题是一个常见问题吗?如何在不重启apache的情况下解决这个问题?
编辑: 似乎有人以前遇到过这个问题: http://codeigniter.com/forums/viewthread/181642/< /a>
I'm using LAMP with CodeIgniter for one of my projects; version controlled by SVN. Every time I execute svn export file:///svnrepo/project/trunk/www . --force
when in the www directory and then reload the web page, it goes blank.
The website only shows up after I do a service httpd restart
(Using CentOS 5).
I want to be able to execute the svn export using a Phing build script in the future and I don't want to have to get root privileges and restart apache every time when I do a build.
Is what I'm experience a common problem? How do I solve it without restarting apache?
Edit:
It seems someone has had this problem before: http://codeigniter.com/forums/viewthread/181642/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好的,我明白了。SVN 维护一个文件的上次修改时间,该时间会抛出 APC 缓存。因此,为了解决这个问题,我们在运行 SVN 导出后更新所有文件的上次修改时间。这是我的最终脚本:
您可以在此处找到更多详细信息。
Ok I got it.SVN maintains a files last modified time which throws off the APC cache. So to solve it we update the last modified time of all the files after we run an SVN export. Here is my final script:
You can find more details here.
另一种解决方案是设置 apc.stat=0 (参考)在 apc.ini 中,然后使用
apc_clear_cache()
(参考) 强制删除操作码缓存。该解决方案的出色之处在于,当 apc.stat 设置为 0 时,它会禁用对每个请求的检查以确定文件是否已被修改。这会带来巨大的性能提升。
此外,使用 apc_clear_cache() 清除 APC 缓存往往会产生更干净的构建。我遇到了不稳定的竞争条件,其中某些文件将被构建,这些文件依赖于尚未构建的其他文件。这会导致一系列致命错误。这里唯一需要注意的是
apc_clear_cache()
需要通过 apache 运行,因此您需要为此实现wget
或类似的东西。An alternative solution would be to set apc.stat=0 (reference) in the apc.ini, and then use
apc_clear_cache()
(reference) to force the removal of the opcode cache.What's awesome about this solution is that when
apc.stat
is set to 0, it disables the check on each request to determine if the file has been modified. This results in a huge performance boost.Additionally, using
apc_clear_cache()
to clear the APC cache tends to result in a cleaner build. I've run into wonky race conditions where certain files will get built out that have dependencies on others that have not yet been built out. This results in a spat of FATAL errors. The only caveat here is thatapc_clear_cache()
needs to be run via apache, so you'll need to implement awget
or something similar for this.