gpt4 book ai didi

php - 文件在服务器上消失

转载 作者:行者123 更新时间:2023-12-02 21:35:02 25 4
gpt4 key购买 nike

我有一个托管在 AppFog 上的 PHP 应用程序有时需要生成一些文件并将其存储在服务器上。文件使用 file_put_contents()imagejpeg()imagepng() 函数保存。一段时间后,文件被删除。你能告诉我为什么以及如何预防吗?

最佳答案

许多 PAAS 提供商(包括 AppFog)不提供持久文件系统。通常,您可以保存文件,但当您重新部署应用程序时它们将被删除。

对于持久文件存储,我们鼓励您使用 Amazon S3 等云提供商。

来自AppFog FAQ :

Does AppFog have a persistent file system?

Not yet. We're working on this feature, but in the meantime, the file system is volatile. This means that any changes you make to the file system through a web interface, including any admin changes and content uploads, will be lost on the app's next start, stop, restart, deploy, or resource change. Because of this, you should make any changes to the file system on a local development environment and keep media assets and content uploads on an external storage system like Amazon's S3.

关于php - 文件在服务器上消失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21605128/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com