• Hi,

    I get random error 500 and error 404 when I use upload_dir as below:

    add_filter('upload_dir', 'lean_upload_dir');
    function lean_upload_dir( $upload ){
    	$upload['url'] = '/files';
    	$upload['baseurl'] = '/files';
    
    	return $upload;
    }

    See the issue here:
    https://passionindesign.com/2014/05/15/安静/

    Mostly, everything is working fine when you first visit the link.
    And then every time you refresh the page, the photos are randomly broken with error 500 or 404. (Please try refresh the page a few times and you will see different images are broken everytime you refresh)

    ———-
    These information might be helpful:
    My WordPress installed on a shared hosting, with virtual memory 512mb

    I think my host provider added this line in my .htacces: “suPHP_ConfigPath /home/my_root_folder/public_html”

    in “my_root_folder”, there is a php.ini (memory_limit = 256M)

Viewing 3 replies - 1 through 3 (of 3 total)
  • Try checking your site’s error logs for a more specific error message. Error 500 is too generic to be of any use. Your hosts should be able to help you accessing your site’s error logs.

    Thread Starter Passion In Design

    (@mayonis)

    Thanks esmi.

    I got this in my error log:

    [19-Jun-2014 05:37:34 UTC] PHP Fatal error:  Out of memory (allocated 10485760) (tried to allocate 196608 bytes) in /home/xxx/public_html/wp-includes/canonical.php on line 249
    [19-Jun-2014 16:19:53 UTC] PHP Fatal error:  Out of memory (allocated 1572864) (tried to allocate 12288 bytes) in /home/xxx/public_html/wp-includes/functions.php on line 3448

    I have talked to my hosting provider and this is their reply:
    ——
    We have checked and found the website hitting the virtual memory limit of 768MB and hence the website shows internal server error. We have increased the virtual memory limit to 1024MB.
    ——

    I am still getting random error 500 or 404 on my images whenever I refresh my webpage.

    Thread Starter Passion In Design

    (@mayonis)

    Revert my wp version to 3.9 and this issue is resolved…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Random Error 500 When Using "upload_dir" Filter’ is closed to new replies.