Production question disallow_file_mods / writing to the uploads directory

Hi,

Is there a way to have DISALLOW_FILE_MODS = true but then make an exception for a specific plugin?

I’m using mergebot and its trying to write a file to

/srv/www/environmentcelebration.com/current/web/app/uploads/mergebot

and its failing:

[03-Jan-2018 13:58:09 UTC] PHP Warning: fopen(/srv/www/environmentcelebration.com/releases/2018010121
5221/web/app/uploads/mergebot/mergebot-deployment-100.sql): failed to open stream: Permission denied i
n /srv/www/environmentcelebration.com/releases/20180101215221/web/app/mu-plugins/fopen_mergebot_test.p
hp on line 9

My solution was to chmod -R a+rwx uploads/mergebot

Is there another way

Thanks,

Neil

You shouldn’t need to change DISALLOW_FILE_MODS in order for the plugin to be able to write to the uploads folder.

Seems like you just had bad permissions on the uploads folder?

1 Like

That’s correct – it was a bad permissions issue.