简体   繁体   English

升级到PHP5.6后,Laravel4 Pagination无法正常工作

[英]Laravel4 Pagination not working after upgrade to PHP5.6

I have a working pagination code on my machine using PHP5.4 After upgrading to PHP5.6 the pagination stays on the first page. 我使用PHP5.4在我的机器上有一个工作分页代码。升级到PHP5.6之后,分页保留在第一页上。 When i clicked on the next page, the address bar show the page number (ie: http://mysite/page?page=4 ). 当我点击下一页时,地址栏显示页码(即: http:// mysite / page?page = 4 )。 However, the button still on page 1. The same code still working on my Windows (WAMP) using PHP5.5. 但是,按钮仍然在第1页。相同的代码仍在使用PHP5.5在我的Windows(WAMP)上工作。 Fyi, im using Freebsd 9.1, Nginx, PHP5.6 (upgraded) Is there something to do with PHP itself, or am i missing some extensions? Fyi,即时通讯使用Freebsd 9.1,Nginx,PHP5.6(已升级)是否与PHP本身有关,或者我错过了一些扩展?

Found extra information, I have installed laravel logviewer package on this app. 找到额外的信息,我在这个应用程序上安装了laravel logviewer软件包。 The pagination that come with this package also didn't works. 这个包附带的分页也没有用。 I suspect that, this is nothing to do with code. 我怀疑,这与代码无关。 Maybe php or nginx config. 也许php或nginx配置。

请检查php(apache)配置并检查是否已激活所需的模块

Thanks guys, I finally solved this. 谢谢你们,我终于解决了这个问题。 However, i didn't find the cause yet. 但是,我还没找到原因。

Originally, my pagination code is like this: {{ $data->links() }} 最初,我的分页代码是这样的:{{$ data-> links()}}

When i use append() in the pagination, it works. 当我在分页中使用append()时,它可以工作。 {{ $data->appends(array('filter1' => $var1))->links() }} {{$ data-> appends(array('filter1'=> $ var1)) - > links()}}

I suspect this is something to do with nginx rewrite. 我怀疑这与nginx重写有关。

i finally figured it out. 我终于弄明白了。 it's true about nginx rewrite. 关于nginx重写是真的。 my previous setting in vhost file is: try_files $uri $uri/ /index.php?q=$request_uri; 我之前在vhost文件中的设置是:try_files $ uri $ uri / /index.php?q=$request_uri;

i changed to try_files $uri $uri/ /index.php?$query_string; 我改为try_files $ uri $ uri / /index.php?$query_string;

this problem is clearly resolved. 这个问题已经明确解决了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM