image upload failing in pkMedia

2 views
Skip to first unread message

cr0wn3r

unread,
Dec 1, 2009, 6:40:02 AM12/1/09
to pkcontextcms
Hi folks

I'm using the pkMedia plugin as part of a symfony 1.2 project that
uses pkContextCMS.

The media plugin has been working fine allowing me to upload images,
browse them, use them in slots etc, but so far its all been using
images smaller than 1mb.

Yesterday I started using some larger images, and on anything much
larger (certainly anything over 2.5mb) the image seems to upload, but
then when it redirects and renders the _editImage.php partial
template, everything halts and a partially rendered page is output.

The output stops just after outputting the opening html for the .form-
row .image div, and the result is a partially completed page with no
sf toolbar (even though I'm in dev), no CSS, and also no errors.

There are no php errors, no errors in the local log, and the
frontend_dev log just finishes with the line that records rendering
the partial:

>> Dec 01 10:23:44 symfony [info] {sfPartialView} Render "/sfProject/plugins/pkMediaPlugin/modules/pkMedia/templates/_editImage.php"

I've checked things like php.ini settings and upped everything just to
make sure they weren't the culprit. Upload limits are now set to
10mb , execution times to a minute and allowed memory usage to
something excessive. Hasn't helped though.

I recognise that this could well be nothing to do with pkMedia, but
all the same any hints, tips, trouble shooting clues etc greatfully
received.

Thanks


Tom Boutell

unread,
Dec 1, 2009, 9:34:43 AM12/1/09
to pkcont...@googlegroups.com
That's a stumper - I suggest you start introducing echo statements and
exit() statements into the _editImage.php partial and moving them
around until you find the point of failure.

Do the originals exist in the web/uploads/media_items folder? (Make
sure they are not size 0.)

You could be hitting your PHP memory limit if you are using the gd
support rather than netpbm. What is your PHP memory limit?
> --
>
> You received this message because you are subscribed to the Google Groups "pkcontextcms" group.
> To post to this group, send email to pkcont...@googlegroups.com.
> To unsubscribe from this group, send email to pkcontextcms...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pkcontextcms?hl=en.
>
>
>



--
Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com

cr0wn3r

unread,
Dec 1, 2009, 9:42:18 AM12/1/09
to pkcontextcms
Thanks for the reply Tom. I am using gd library, so you might be
right. Memory limit is 64 mb. I'll increase it and try again.
> > For more options, visit this group athttp://groups.google.com/group/pkcontextcms?hl=en.

Tom Boutell

unread,
Dec 1, 2009, 10:32:24 AM12/1/09
to pkcont...@googlegroups.com
Yes, gd needs 4 bytes per pixel for truecolor images... 1000 x 1000 x
4 = 4MB, but 4000 x 4000 x 4 = 64MB. So it depends on the pixel
dimensions (not compressed JPEG file size) of your originals. If you
can, install netpbm.
> For more options, visit this group at http://groups.google.com/group/pkcontextcms?hl=en.

Alex Gilbert

unread,
Dec 1, 2009, 10:48:53 AM12/1/09
to pkcont...@googlegroups.com
This man knows his gd library.
Alex Gilbert
P'unk Avenue
215-755-1330
al...@punkave.com

cr0wn3r

unread,
Dec 1, 2009, 12:57:42 PM12/1/09
to pkcontextcms
True enough :)

I've never used netbpm so always just default to gd for doing image
stuff. Might be time to investigate though.

For this particular problem it doesnt seem to be the cause as I've
upped the memory limit to 128mb and its still behaving the same way.

The file isnt making it to the uploads folder at all, so it's
something earlier in the chain I guess.



On Dec 1, 3:48 pm, Alex Gilbert <a...@punkave.com> wrote:
> This man knows his gd library.
>
>
>
> On Tue, Dec 1, 2009 at 10:32 AM, Tom Boutell <t...@punkave.com> wrote:
> > Yes, gd needs 4 bytes per pixel for truecolor images... 1000 x 1000 x
> > 4 = 4MB, but 4000 x 4000 x 4 = 64MB. So it depends on the pixel
> > dimensions (not compressed JPEG file size) of your originals. If you
> > can, install netpbm.
>
> > For more options, visit this group athttp://groups.google.com/group/pkcontextcms?hl=en.
>
> --
> Alex Gilbert
> P'unk Avenue
> 215-755-1330
> a...@punkave.com

Tom Boutell

unread,
Dec 1, 2009, 1:54:58 PM12/1/09
to pkcont...@googlegroups.com
Try:

./symfony plugin:permissions

I have a feeling your permissions got whacked somewhere.
> For more options, visit this group at http://groups.google.com/group/pkcontextcms?hl=en.

Tom Boutell

unread,
Dec 1, 2009, 1:55:25 PM12/1/09
to pkcont...@googlegroups.com
Excuse me, that should have been:

./symfony project:permissions

On Tue, Dec 1, 2009 at 12:57 PM, cr0wn3r <pete...@googlemail.com> wrote:
> For more options, visit this group at http://groups.google.com/group/pkcontextcms?hl=en.

cr0wn3r

unread,
Dec 1, 2009, 5:32:42 PM12/1/09
to pkcontextcms
After all that, it looks like the problem was with the memory limit
after all....

I foolishly assumed that setting the max memory to 128 was overkill
for pretty much anything - without doing the math.

The test images I was using were around 6000x4800... which comes out
at around 110mb memory usage by your math Tom. Obviously close enough
to the 128 to be the issue as upping it to 258 solves the problem
completely.

Thanks for your help - I should have checked it more thoroughly.

Clearly those images are unrealistically large, but now that I
understand where the limit comes from I can set it to something
reasonable and make sure the users of the site know what the
boundaries are.

Tom Boutell

unread,
Dec 1, 2009, 7:28:15 PM12/1/09
to pkcont...@googlegroups.com
Sounds good. If you are going to deal with big images regularly you
should definitely install netpbm, which doesn't need to allocate the
entire image in memory ever.
> For more options, visit this group at http://groups.google.com/group/pkcontextcms?hl=en.
Reply all
Reply to author
Forward
0 new messages