Error 500 / Uploading Images Only
  • Hi - this is an odd error/glitch

    I have my version of Newscoop installed properly with the right permissions on directories etc.
    I can upload files to Newscoop in the media-archive section, however I can't seem to upload images. Whenever I click the 'save all' button after selecting my images, it seems to pass data, however it then redirects to 'do_upload.php' which then returns Error 500!

    Has anyone experienced this? 
    I'm running Newscoop on CentOS v6 

  • 5 Comments sorted by
  • Hi Marc,

    What version of Newscoop exactly? latest?
  • Hi Holman,

    Yes, 4.1.0
  • Hi,

    we found where is a problem and workaround is add package php-process by command:
    yum install php-process

    Reason is, that PHP hasn’t posix enabled.

  • Hi All.
    I have same problem with upload only images. No matter in news editing, or immediately in the media archive. Any other files uploaded w/o problem.
    I cheked
    /var/log# pkg_info | grep posix
    php5-posix-5.4.11   The posix shared extension for php
    At the same time in acess log i see error - - [01/Mar/2013:13:01:32 +0200] "GET /admin/media-archive/edit.php?f_image_id=97 HTTP/1.1" 500 -
    it is an internal server error, but what a mistake I do not know, because the error-log is empty.

     NC 4.1.0 FreeBSD 8.3

    Post edited by Ruslan Shilov at 2013-03-05 05:11:13
  • I ran into this too in version 4.1.

    For reasons I won't get into here, I can't enable posix in the version of PHP we have, so I modified the chmod function of the Image class like so:

    private static function chmod($path, $mode)
            if (function_exists('posix_getuid')) { //@ajh work around lack of posix support
                if (posix_getuid() === fileowner($path)) {
                    chmod($path, $mode);
                } else {
                    chmod($path, $mode); //this will just return false and silently fail if I've read the documentation properly

    Anyway - I realize this probably isn't recommended, but I needed to solve the problem, and this does. Maybe it'll help someone else.

    Of course, a Newscoop upgrade will probably overwrite this change, but hopefully we'll have moved hosts by then :-)