WHMCS MU Provisioning Causing Media to Not Upload

I'm having an issue with a site on my multisite install. I've never seen this before, but WP is not uploading media to the blogs.dir folder. However, it's working for all remaining sites on the network. The only one it isn't working on is the one that was created by this plugin.

I've tried creating new sites manually and they work fine. I've also tried creating a new site using the provisioning plugin and the new site is behaving in exactly the same way - not uploading the media files.

I've attached a screenshot of what the media uploader shows after I've uploaded a file. I've tried both the single file and multi file uploader. Notice how the thumbnail of the image isn't showing. I've gone through the settings on each of the sites and everything appears to be correct.

Any thoughts? Can you help me with troubleshooting further? Thanks!

  • Kimberly
    • Champion of Loops


    Looking around for information on this I cannot see anything that immediately jumps out at me as being a possible issue.

    Is the picture in the file you are seeing the url path to when you save it?

    can you check your root and make sure you don't have any stray sub directories named 'files'?



  • Ryan Englin
    • Design Lord, Child of Thor

    I don't see any stray directories named 'files'. I've also checked the path to the file and it isn't being uploaded to the blogs.dir folder even though WP lists a URL in the media record.

    I'm thinking it has to be something specific to sites created with the provisioning plugin since sites created other ways are working just fine. Unfortunately I don't know enough about how the plugin works to troubleshoot on my own.

  • Arnold
    • El Macho WP

    The file on multisite will be uploaded to a


    directory where xxx is the blogs ID number. This gets shortened to just files by permalinks.

    Look and see if the directory was actually created. If not try creating it and see if that lets you upload. It may be a permissions problem so if it exists but you can't load look at the permissions on the directory.

  • Ryan Englin
    • Design Lord, Child of Thor

    Yeah, I've already checked the folder. The folder for the site ID is being created. In this case /wp-content/blogs.dir/2 but nothing is being created below that folder when I upload. I don't get a year or month folder in other words. I've checked the permissions and this folder is wide open.

    It just seems like it has something to do with the provisioning plugin because if I create a site manually (click Sites -> Add New in network admin) everything works fine. If it's a setting I missed in WHMCS for setting up the add on, please let me know.

  • Ryan Englin
    • Design Lord, Child of Thor

    Thanks Arnold. Haven't been able to isolate the issue yet, but I do have more information now. So I checked to make sure the files folder was created, and it was but WP wasn't able to get to it because it was set with 341 for permissions. Which makes no sense to me how it got this way. When I updated through FileZilla it showed correct permissions, but they apparently weren't taking. Once I went through cPanel and made the change to the permissions, I could again see the files folder. And then after making permission changes on that folder I could see the next one and so on.

    It looks like all of the files were being uploaded, but couldn't be read by the system because of the permission issues.

    It has to be something with the provisioning plugin because if I create a site the manual way it works fine. Do you think this is something in the code that needs to be corrected? or something in my settings?

  • Ryan Englin
    • Design Lord, Child of Thor

    Ok, I think I got this. Can you forward to developer to confirm? I went through the source for whmcs-mrp.php and noticed that on line 427, the mkdir command was missing a leading zero for the permissions.

    Once I added the leading zero and tested a new site through WHMCS, I was able to upload media due to correct permissions on the blogs.dir/x/files folders.

    The current line reads:
    mkdir(WP_CONTENT_DIR.'/blogs.dir/'.$id . '/files', 755, true);

    I changed it to read:
    mkdir(WP_CONTENT_DIR.'/blogs.dir/'.$id . '/files', 0755, true);

    This was based on information I read at php.net that the permissions should be an octal (this part is way over my head). If this in fact the fix, I'd like it to be included in future updates of the plugin so we don't have to worry about this again.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.