【问题标题】:phpfog Application runtime path is not validphpfog 应用程序运行时路径无效
【发布时间】:2012-03-29 19:40:38
【问题描述】:

我正在尝试在 phpfog 上实现 yii 框架附带的一个小默认应用程序。 我已经按照使用 GIT 的说明安装了它。现在,当我尝试运行它时,我收到了这个错误(如下)。 我已经检查以确保该目录是可写的并且所调用的目录确实存在。我被卡住了,接下来该怎么办?

Application runtime path      /var/fog/apps/app35423/austintxous.phpfogapp.com/demos/emp/protected/runtime" is not valid.     
Please make sure it is a directory writable by the Web server process.
259             return $this->_runtimePath;
260         }
261     }
262 
263     /**
264      * Sets the directory that stores runtime files.
265      * @param string $path the directory that stores runtime files.
266      * @throws CException if the directory does not exist or is not writable
267      */
268     public function setRuntimePath($path)
269     {
270         if(($runtimePath=realpath($path))===false || !is_dir($runtimePath) ||     
!is_writable($runtimePath))
271             throw new CException(Yii::t('yii','Application runtime path "{path}" is 
not valid. Please make sure it is a directory writable by the Web server process.',
272                 array('{path}'=>$path)));
273         $this->_runtimePath=$runtimePath;
274     }
275 
276     /**

277      * Returns the root directory that holds all third-party extensions.
278      * @return string the directory that contains all extensions. Defaults to the  
'extensions' directory under 'protected'.
279      */
280     public function getExtensionPath()
281     {
282         return Yii::getPathOfAlias('ext');
283     }

【问题讨论】:

  • 要调试更多,将 if(($runtimePath=realpath($path))===false || !is_dir($runtimePath) || !is_writable($runtimePath)) 拆分为两个 if查看哪个部分失败的语句: this $runtimePath=realpath($path))===false 或 this !is_dir($runtimePath)
  • 目录可由哪个用户写入?尝试将权限更改为 777(仅用于调试)并再次检查。如果有效,则表示写入权限不适用于正确的用户。
  • 我试过这个,它给了我应用程序运行时路径“/var/fog/apps/app35423/austintxous.phpfogapp.com/demos/emp/protected/runtime”的结果无效。请确保它是 Web 服务器进程可写的目录。 " 但是,据我所知,该目录确实存在于该位置。我的意思是,当我在本地克隆存储库时,该目录就在那里。

标签: yii frameworks phpfog


【解决方案1】:

Web 服务器无法写入运行时目录。确保它存在,并将其所有权更改为您的 Web 服务器,或设置 chmod 777(如果它是您的开发环境,这是一个很好的解决方案)。

cd [project directory]
chmod 777 protected/runtime

【讨论】:

  • phpfog.com 是我们的主机,他们有一个设置权限的实用程序。我将“受保护”文件夹的权限设置为可由 seb 服务器写入,但仍然出现相同的错误。
  • 好的,现在你需要在运行时文件夹中设置它们。
【解决方案2】:

你有防火墙在运行吗?

也许它阻止了写访问?

【讨论】:

    【解决方案3】:

    你必须像这样配置允许 php-fpm 对目录的写访问权限

    # semanage fcontext -a -t httpd_sys_rw_content_t 'YOUR_PATH_HERE'
    # restorecon -v 'YOUR_PATH_HERE'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-23
      • 2012-01-25
      • 1970-01-01
      • 2021-07-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多