2014-04-17 06:53
浏览 70

Laravel 4.1中的phpgrid不支持域掩码

I'm using Laravel 4.1. I put phpgrid into the vendors directory. Here are my paths using example domains:

Actual file path to website root: /home/.../htdocs/dashboard/public

Actual file path to phpgrid: /home/.../htdocs/dashboard/vendor/phpgrid

The (example) url to the site is:

The SERVER_ROOT is set to:

phpgrid works when I use that domain. The problem is that I want to use a shorter domain with masking. So the url I want to use is something like:, and the virtual host has it pointing to the actual file path to the website root directory above. phpgrid builds the table, but then the AJAX fires and can't get to the vendor directory because it is now below the site root of the masked domain. I thought it would use the absolute path, but it doesn't seem to. Any ideas?

图片转代码服务由CSDN问答提供 功能建议

我正在使用Laravel 4.1。 我把phpgrid放到vendor目录中。 以下是使用示例域的路径:

网站根目录的实际文件路径: / home /.../ htdocs / dashboard / public \ n

phpgrid的实际文件路径: / home /.../ htdocs / dashboard / vendor / phpgrid

(示例)url to 该网站是:

SERVER_ROOT设置为: http://www.site1 .com / dashboard / vendor / phpgrid

phpgrid在我使用该域时起作用。 问题是我想使用带有屏蔽的较短域。 所以我想使用的URL是: ,虚拟主机指向上面网站根目录的实际文件路径。 phpgrid构建表,但随后AJAX触发并无法访问 vendor 目录,因为它现在位于被屏蔽域的站点根目录之下。 我认为它会使用绝对路径,但它似乎没有。 有什么想法吗?

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • douxia3505 2014-06-15 02:17

    It turns out that the issue was with the AJAX calls. AJAX will not let you call a different domain for security reasons, so setting the SERVER_ROOT to a different domain than my masked domain was failing (silently btw, blank error message in phpgrid). So I was forced to move the phpgrid files and folders into the webroot and change the SERVER_ROOT to a relative path.

    A simple fix although I would have preferred to keep the files in the vendor directory.

    解决 无用
    打赏 举报

相关推荐 更多相似问题