views:

26

answers:

1

I have recently moved a drupal site. (both servers run on a debian based LAMP stack) Everything works great here, including the uploading of images via a CCK filefield. Original url: dev.example.com/foo

Deploying it to a test folder on the production server to a test folder for an environmental shakedown cruise lead it here: www.example.com/foo

Everything works here too, including image uploads. After adjusting sites/default/settings.php, then making it readonly again, I renamed the folder to its production name: www.example.com/bar

Everything works fine here except for image uploading. I've adjusted the webroot variable within settings.php .

Things I have tried so far:

  • Gave php system user write permissions to sites/default/files (images are set to go in sites/default/files/images but imagecache just puts them in sites/default/files)
  • Enabled file php file uploading for www.example.com/bar/sites/default/files

Are there any other configuration settings I should be looking out for here? I'm running low on relevant solutions.

Edit: I had quite the typo there, I adjusted sites/default/settings.php, not sites/default.settings.php .

A: 

Your question is slightly confusingly framed. default.settings.php has no impact on Drupal -- its merely a template. The file that contains the actual database connection information and other configuration is settings.php.

You may also want to look at your .htaccess file in your root Drupal folder and try changing the RewriteBase directive to the folder you are accessing your site on. Usually you should not have to change the $base_url directive in the settings.php file that you may/may not have done. Reverse that change for now if you have (you may need to play around with that later though).

imagecache will always upload the image derivatives in sites/default/files but imagefield will upload the original image in the folder you specify (within sites/default/files). You will get a setting for the imagefield under Manage Fields->[Name of Image field]->Configure under Path Settings.

Please google to understand the difference between imagecache and imagefield. Make sure your sites/default/files (and subfolders) are writable by the apache user (usually www-data).

In such situations, its usually a good idea to pick up a book on apache (if you haven't already) and try to understand how it works. It will be time consuming but will help you out in the future when you encounter configuration issues like this.

Sid NoParrots
Thanks for the advice. I'll try rolling back the settings.php file and adjusting .htaccess instead. I don't have full apache access on this box but I definitely see your point about learning more about it.
ford