drebew5059 2014-11-29 01:12
浏览 54
已采纳

在HHVM中实施Kohana时拒绝许可

I am trying to implement Kohana framework within HHVM. The problem I am having is, im getting "Permission denied" exception from the below function under Kohana View class. (SYSPATH/classes/view.php). It is throwing exceptions while trying to include the template files. (include $kohana_view_filename;). In my case the file is /application/views/templates/default_page.php which has 777 permission. We are running apache2 on Ubuntu 14.04.1 LTS. Im not sure if the issue is with ubuntu or hhvm. Any idea how to sort it out ?

protected static function capture($kohana_view_filename, array $kohana_view_data)
    {
            // Import the view variables to local namespace
            extract($kohana_view_data, EXTR_SKIP);

            if (View::$_global_data)
            {
                    // Import the global view variables to local namespace
                    extract(View::$_global_data, EXTR_SKIP);
            }

            // Capture the view output
            ob_start();

            try
            {
                    // Load the view within the current scope
                    include $kohana_view_filename;
            }
            catch (Exception $e)
            {
                    echo $kohana_view_filename.':'.$e->getMessage().'<br/>';

                    // Delete the output buffer
                    ob_end_clean();

                    // Re-throw the exception
                    throw $e;
            }

            // Get the captured output and close the buffer
            return ob_get_clean();
    }
  • 写回答

1条回答 默认 最新

  • duanlin1931 2014-12-02 10:24
    关注

    Such message tells that PHP can't access file in filesystem tree.

    Most likely you haven't provided required permissions to parent folder(s).

    For example:

    • you have file in /var/www/file.php and its permissions are 777: it's full access.
    • but /var/www/ folder itself has owner of root and 500 permissions: only root can only read folder contents and execute (change path to) it.

    So apache while accessig /var/www/file.php file under apache has to go to /, then to /var/, then to /var/www/, then open /var/www/file.php.

    Because of unsufficent permissions on /var/www/ you're getting Permissions denied error.

    So make sure you have sufficent permissions in every parent folder. Good luck!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 java报错:使用mybatis plus查询一个只返回一条数据的sql,却报错返回了1000多条
  • ¥15 Python报错怎么解决
  • ¥15 simulink如何调用DLL文件
  • ¥15 关于用pyqt6的项目开发该怎么把前段后端和业务层分离
  • ¥30 线性代数的问题,我真的忘了线代的知识了
  • ¥15 有谁能够把华为matebook e 高通骁龙850刷成安卓系统,或者安装安卓系统
  • ¥188 需要修改一个工具,懂得汇编的人来。
  • ¥15 livecharts wpf piechart 属性
  • ¥20 数学建模,尽量用matlab回答,论文格式
  • ¥15 昨天挂载了一下u盘,然后拔了