Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory exhausted when initializing file storage #24

Open
CasperAlant opened this issue Apr 28, 2018 · 1 comment
Open

Memory exhausted when initializing file storage #24

CasperAlant opened this issue Apr 28, 2018 · 1 comment

Comments

@CasperAlant
Copy link

Hello, I'm getting memory exhausted errors with this library in production. I've tried increasing the allowed memory usage, but 400MB is more than I am comfortable with.

PHP Fatal error:  Allowed memory size of 419430400 bytes exhausted (tried to allocate 33554432 bytes) in .../user.php on line 142
PHP Fatal error:  Allowed memory size of 419430400 bytes exhausted (tried to allocate 33554432 bytes) in .../user.php on line 141
PHP Fatal error:  Allowed memory size of 419430400 bytes exhausted (tried to allocate 33554432 bytes) in .../vendor/birke/rememberme/src/Authenticator.php on line 75

The respective lines in .../user.php are:

135. $storagePath = settings::user_tokens_path;
136. if(!is_writable($storagePath) || !is_dir($storagePath)) {
137. die("'$storagePath' does not exist or is not writable by the web server.
138.        To run the example, please create the directory and give it the
139.         correct permissions.");
140. }
141. $storage = new FileStorage($storagePath);
142. $rememberMe = new Authenticator($storage);

Any help would be appreciated.

P.S. Thanks for this awesome library.

@CasperAlant
Copy link
Author

I switched to the PDO Storage which fixed it for me. So obviously the problem is with the FileStorage. Also, it seemed to only affect certain users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant