Drupal 7.9 multisite

Unable to save to file in any location (including public and private folders). Not a permissions issue (eg tried 777 to be sure).

Currently, the response simply reads: "Can't write to the specified location". A closer look and we find the following code in aes.module around L242:

function aes_config_validate($form, &$form_state) {
...
//if the storage method is set to File, check that the file can be openend for writing
if ($form_state['values']['aes_key_storage_method'] == "File") {
  $fp = fopen($form_state['values']['aes_key_path'], "a");
  if ($fp === false) {
   @form_set_error("aes_key_path", t("Can't write to the specified location."));
  }
  else {
   fclose($fp);
  }
}
...

I removed the "@" on line 242 to see the error message, which simply referred back to this line. (However see what SPTM say about using "@")

Anyhow, see also this documentation issue -- in order to get this working, I had to create the file first in the private directory and then provide the full path to it (/var/www/sites/.../files/private/.aeskey). I don't know why the php fopen(..., "a") wouldn't create the file.

Comments

thanks man this really helped i was breaking my head until i saw your post

This is uber-furstratin. I cannot get it to work no matter what I do. I chaged permissions, did what it shows here....Nothing. No dice.

Well, I got it working only after reseting multiple folders to 777 and then setting back to normal.

I did forget to mention this is an Aegir-controlled install, so there are issues with folder ownership between the "aegir" user and the www-data user.

That helped here also, with the latest versions etc. as of this post date.

Have .aeskey file ownership as php user, with nginx allowing internal access only.