简体   繁体   中英

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. When i clicked on the next page, the address bar show the page number (ie: http://mysite/page?page=4 ). However, the button still on page 1. The same code still working on my Windows (WAMP) using PHP5.5. Fyi, im using Freebsd 9.1, Nginx, PHP5.6 (upgraded) Is there something to do with PHP itself, or am i missing some extensions?

Found extra information, I have installed laravel logviewer package on this app. 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(apache)配置并检查是否已激活所需的模块

Thanks guys, I finally solved this. However, i didn't find the cause yet.

Originally, my pagination code is like this: {{ $data->links() }}

When i use append() in the pagination, it works. {{ $data->appends(array('filter1' => $var1))->links() }}

I suspect this is something to do with nginx rewrite.

i finally figured it out. it's true about nginx rewrite. my previous setting in vhost file is: try_files $uri $uri/ /index.php?q=$request_uri;

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

this problem is clearly resolved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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