douwen5546 2014-04-16 22: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: http://www.site1.com/dashboard/

The SERVER_ROOT is set to: http://www.site1.com/dashboard/vendor/phpgrid

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: http://dashboard.myotherdomain.com/, 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?

  • 写回答

1条回答 默认 最新

  • douxia3505 2014-06-14 18: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.

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

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部