douwen5546 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: 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-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.

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

报告相同问题?

悬赏问题

  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化