Internal error on image upload



  • Hi all,

    I've managed to install Ideaspace. When I try to create a space, it gives me an internal server error.

    I can enter the title and url however when I try to upload my photosphere, it crashes and returns internal server error. I've attached a screenshot of the error.

    Thanks in advance.

    0_1465401853100_Screen Shot 2016-06-08 at 11.58.56 PM.png



  • Hi,

    please make sure that your public directory (and all sub-directories in it) are writeable by your web-server, because the uploaded images are stored there (in public/assets/user/media/images/).

    If you still get this error, I suggest that you send me your log file ( /storage/logs/laravel.log ) as there are more details in it and I can assist you better (please send to [email protected]).

    Thanks,

    Chris



  • Hi Chris,

    The folder permissions have all been set to 755 by default.
    The upload happens as I can see the original file on the server with the new filename.

    I think the script to generate the thumbnails is the cause of the error.

    There was no file in the folder location you mentioned.

    The images I'm trying to upload aren't that large. The smallest was around 1.8MB and the largest was 9MB.

    The script did successfully run and resize when the original image was under 1MB. Is there a limit to the size of the uploaded image?

    Thanks!



  • The only limits are your max upload file / post size which are 32MB according to your screenshot.

    Do you have access to your php.ini configuration file? If yes, there is a memory_limit parameter which is maybe set to low. Mine is set to: memory_limit = 128M

    The reason is that image resizing takes a lot of memory. I should probably mention that in the installation docs and / or set the limit in PHP.

    Let me know if this is the case for you.

    Chris



  • The memory limit is set to 768M.
    Other parameters are as follows

    Max execution time: 300
    apc.shm size: 512M

    Is it possible to add in a function to manually generate the thumbnails in a separate step, if it fails when the image is initially uploaded.

    I use Wordpress as well for other websites and there have been times where the thumbnail generation fails. To fix this, I've been using a plugin to force a selected image to regenerate its thumbnail.



  • It is not possible in the current version of IdeaSpace, but I keep the idea in my mind.

    It would help if you could send me the log file (/storage/logs/laravel.log), because there is no reason why the thumbnail generation should fail. And it would help to make IdeaSpace better. Thanks!



  • I did more testing today and I can only upload images that are less than 1MB.
    It makes sense to use a minimal filesize especially for web viewing.

    In any case, the log was finally generated. I've emailed it to you as requested.



  • I am currently investigating the issue. I uploaded an image with 32MB without any problem. In another test I uploaded 15 image files where the smallest had 1.2MB and the largest 9MB. My server has 8GB of RAM.

    Thanks for the log file, it says the issue is a memory error when the images are being resized.

    I will come back to you.



  • Did you check the memory_limit value if you dump your php configuration with phpinfo()?

    If you use the Photosphere Viewer theme you can configure the image quality in themes/photosphere-viewer/functions.php. It is set to 75 per default. You could lower this value in order to reduce memory consumption.

    Some configuration in your system does not allow PHP to allocate more memory. According to your log it looks like that 132120576 Bytes is the maximum and the additional 33554433 bytes for resizing the image cannot be allocated.
    You could try to configure the memory_limit = -1 so PHP would take what it needs.


Log in to reply