Error when viewing all files or single file

    • Page Marino
      Participant
      # 4 months ago

      When I attempt to view my private files or open an individual file from my customer area dashboard WordPress errors out without any error logs or explanation.

      I’ve run this through X-debug and the error that it’s picking up is Error: Undefined constant “BLOGUPLOADDIR”

      Is this a known error? This is running as a multisite and the trace seems to dictate that it’s coming from ms-files.php.

      I’ve attached a screenshot of the X-debug breakpoint.

    • Thomas
      Keymaster
      # 4 months ago

      Hi,

      I don’t think its related with multisite but with your local installation. Are you using a VM (or something similar) that automatically install & configure nginx/apache?

      I’ve already faced this issue when running WordPress locally on a VM. I was using VVV, and the nginx config from this stack was including redirections rules on the slug “files” that was interfering with our “files” permalinks.

      In this stack, we found the following code in a file named nginx-wp-common.conf, that we had to comment out, and then re-provision the VM.

      # Pass uploaded files to wp-includes/ms-files.php.
      # rewrite /files/$ /index.php last;
      
      # if ($uri !~ wp-content/plugins) {
      #    rewrite /files/(.+)$ /wp-includes/ms-files.php?file=$1 last;
      # }
      

      You’re probably not using the same tools, so you won’t find the exact same code, but I bet there is something in your nginx/apache/htaccess configuration that redirects all “files” slug to the WP files handler instead of our plugin.

      I hope that helps.

      Regards.

       

Viewing 1 reply thread

The topic ‘Error when viewing all files or single file’ is closed to new replies.