访问临时文件夹时出现权限问题


Permission probllem gaining access to a temp folder

我正试图让SilverStripe在谷歌应用程序引擎上工作,但它给出了以下错误:

PHP Fatal error:  Uncaught exception 'Exception' with message 'Permission problem gaining access to a temp folder. Please create a folder named silverstripe-cache in the base folder of the installation and ensure it has the correct permissions' in /base/data/home/apps/s~my_app_id/1.371770119107113254/framework/core/TempPath.php:84
Stack trace:
#0 /base/data/home/apps/s~my_app_id/1.371770119107113254/framework/core/TempPath.php(9): getTempParentFolder('/base/data/home...')
#1 /base/data/home/apps/s~my_app_id/1.371770119107113254/framework/core/Constants.php(238): getTempFolder('/base/data/home...')
#2 /base/data/home/apps/s~my_app_id/1.371770119107113254/framework/main.php(58): require_once('/base/data/home...')
#3 /base/data/home/apps/s~my_app_id/1.371770119107113254/index.php(66): require_once('/base/data/home...')
#4 {main}
thrown in /base/data/home/apps/s~my_app_id/1.371770119107113254/framework/core/TempPath.php on line 84

听起来您需要使用gs://stream包装器将临时文件夹配置为指向Google云存储。本地文件系统在GAE上是不可写的,这就是默认文件系统不起作用的原因。

从LevB的评论来看,似乎您将TEMP_FOLDER常量设置到了适当的位置。在这种情况下,它应该类似于gs://mybucket/temp

请确保创建一个bucket并设置允许您的应用程序访问它的权限。有关更多信息,请参阅:https://developers.google.com/appengine/docs/php/googlestorage/.

创建可写目录,并使用TEMP_FOLDER常量将其设置为缓存目录。

有关详细信息,请参阅环境管理。