开发者

PHP session won't load? Memory issue?

开发者 https://www.devze.com 2023-02-18 16:03 出处:网络
I have a page that allows you to input customer information, which sends to a page to process information. If the information is correct, it is recorded to the database. Any incomplete information is

I have a page that allows you to input customer information, which sends to a page to process information. If the information is correct, it is recorded to the database. Any incomplete information is sent to another page to be modified. The incomplete information is stored in a $_SESSION array ex $Cu开发者_StackOverflow社区stomerEntry[$LineCount][$CellCount]. It seems when the array gets over a certain size, the correction page is never loaded. It stalls on the process page.

I have unset any unneeded variables. Checked the amount of memory allowed to be used by the server and that specific page. The largest entry I have gotten to go to that page so far has been $LineCount of 5 and $CellCount of 9, anything more than that stalls.

What can I do to possible fix this?


I've never heard of such an issue. Try

error_reporting(E_ALL);
ini_set('display_errors','On');

to make sure that there are no other problems. Put this to your processing php file.


Assuming you're using the standard PHP file-based sessions, you can get a rough idea of how big the session file is by doing:

$session_file = session_save_path() . '/sess_' . session_id();
echo(filesize($session_file));

On most systems, that should spit out the size of the session file in bytes. Note that it's stored in serialized form, so the on-disk size will be slightly different than what it'd be if you loaded up the session.

However, if the session file was too big to start with, you wouldn't get half-way into your code and then die - it'd die right at the moment you did a session_start(), and would also bring into question how the session could get that big to start with. If it's too big to read in, it should have been too big to fit into memory originally.

0

精彩评论

暂无评论...
验证码 换一张
取 消