Controller.php trows fatal error on line 762
This "memory exhausted" error appears after one attempt to upload 2 jpg's. PHP memory limit is 32MB.
Is it unrealistic to expect TypoLight to handle these two files correctly?
- 750KB of 2048x1536px
1.5MB of 3264x2448px
If so please read on to find out what happens when i do just that.
Error trown in backend file manager /typolight/main.php?do=files
Code:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 13056 bytes) in /home/user/domains/domain.com/public_html/system/libraries/Controller.php on line 762
:( I run a new install of Typolight 2.7.2 on
- CENTOS
PHP Version 5.2.8
Apache 1.3.41
MySQL 5.0.41
Without safe mode (had some unresolved issues with that) and instead using chmods (which appears to have the wrong user). When i manually remove the file the error disappears, but does not resolve the problem when again uploading anything other than tiny gif or jpg files.
Was not able to validate the error on the TL demo, as it has uploads set to disabled.
Possibly related:
As previously unresolved in the old forum http://www.typolight.org/forum/message/76455.html reading:
Quote:
Hi there,
I have just manually updated from 2.6.7 -> 2.7 and I got this bug for my news section:
Code:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2832 bytes) in /home/asia/public_html/main/system/libraries/Controller.php on line 762
I have checked my host and Memory Limit is 32MB - which is pretty ok. It worked for 2.6.7 so I'm not sure if I have some mistakes updating to the new version. I have used the check tool provided by Leo and everything is fine, database is up to date as well.
Some more info:
Apache version 2.2.8
PHP: 5.2.6
MySQL: 5.0.67-community
Thanks for reading and appreciate any help(s),
Hieu.
Re: Controller.php trows fatal error on line 762
Barryke - I recently went through this same issue on a site. You need to increase the memory_limit to something like 64MB or 128MB. The reasoning is that it takes more processing power than just the size of the images. If you can't change the global php.ini, maybe your host lets you create individual / custom ones in your hosting folders. The one with the increased memory limit needs to go in the /typolight folder.
Re: Controller.php trows fatal error on line 762
Thanks for the heads up Ben!I have been trying to avoid just that though. :(
If this issue occurs occasionally in the backend i'm fine with adjusting the memory limit as it would surely remedy the problem.
However i'm worried the memory usage also tops out in the frontend, even when the "huge" image isn't referenced on the page. Let me test this (back in a jiffy) ...
Extention Idea
An debug extention that reports [average peak memory usage] since [the extention was activated] on each [frontend or backend page] would be usefull to diagnose such things.
Re: Controller.php trows fatal error on line 762
Keeping a log to myself here, this figuring out gets complicated.
Will update the topic title when due. A lot of issues come into play here.. one affecting the other..
I kept the Memory Issue out of the way;
- I have adjusted the memory limit via .htaccess:
Code:
# TYPOlight
php_value memory_limit 64M
[/*:m:ys5pujym]
Images that where stored without proper resizing still gave errors. I removed those via FTP.
I believe several things still go wrong in my installation:
- Using the PHP safe mode hack (ftp) everything works but no image is resized.[/*:m:ys5pujym]
- Without using the PHP safe mode hack (ftp) files get owner Apache instead of User.[/*:m:ys5pujym]
So i tried:
- I disabled PHP safe mode hack (ftp) via the interface.[/*:m:ys5pujym]
- A (theoretically pointless) recursive chmod 777 for /tl_files/[/*:m:ys5pujym]
Now files are uploaded (and resized !) correctly.
Files are now attributed to user "apache" while any other file is from "user". Is that normal?
This gave errors in the past, so i'll pick this log up when these show up.
Re: Controller.php trows fatal error on line 762
Barry,
I think that you won't be able to manage (delete) files that are owned by Apache. I've been on web hosts in the past (MediaTemple's "dedicated-virtual") that had this problem. I've found it better just to go with a properly-configured host if you can't get the proper over-rides working. (just my $0.02)
Re: Controller.php trows fatal error on line 762
Quote:
Originally Posted by Ben
Barry,
I think that you won't be able to manage (delete) files that are owned by Apache. I've been on web hosts in the past (MediaTemple's "dedicated-virtual") that had this problem. I've found it better just to go with a properly-configured host if you can't get the proper over-rides working. (just my $0.02)
Glad to hear that confirmed!
My service provider insists that their configuration is fine, and i was getting my doubts a few months ago when not finding any other TL users that solved the issue without switching hosts.
Re: Controller.php trows fatal error on line 762
I have the same problem. When uploading jpegs I get an memory error. I use typolight 2.6.7.
The problem is a live website and needs to be fixed as soon as possible. And I don't know what to tell my client to do... Even if there is a work around that would help.
The safe mode hack had no influence on the problem.
Also uploading the images via ftp manually does not work
Thanks,
Jaap
Re: Controller.php trows fatal error on line 762
Increasing the memory limit does not work either
Re: Controller.php trows fatal error on line 762
Maybe you have to increase it further. And make sure that the pics aren't that big – file size and pixel dimensions are not the only indications. Check e. g. whether the image uses CMYK or how big the dpi is (96 should be enough for non-print).
Seriously, in the web a few people need such large files. This does not apply to customers that need high quality photos, though. What kind of business does your client run? Do they need full image resolutions und quality?
Did you try to disable image preview in the user settings?
Re: Controller.php trows fatal error on line 762
I found a solution. Increasing the memory limit in htaccess did not work. So I did this with ini_set in the code.
Also I found other comments on the internet that imageresizetruecolor could use a lot of memory. In my case the pictures where less then 1MB...
Thanks,
Jaap
Re: Controller.php trows fatal error on line 762
They maybe appear to be only 1 MB big but as soon as they are uncompress their size might explode (just open one and save it as a raw image).