Strange Image upload problem
  • Hi
    I'm new to Campsite, so this is my first installation. I'm running Campsite 3.4.3 with installed sample data and default templates. In the period of testing everything worked as it should including image upload and thumbnails creation.

    Later on I start using my own template with the real issue/section/article architecture and I still didn't have any kind of problems.

    Than in some point image upload process started to report error.


    Error ID: 	2:Campsite:3.4.3:Image.php:520
    Error String: 	chmod() [function.chmod]: Operation not permitted
    Time: 	Mon, 06 Dec 2010 12:47:25 +0100
    Backtrace: 	
    
    camp_report_bug() called at [:]
    chmod() called at [/var/www/html/site/classes/Image.php:520]
    Image::OnImageUpload() called at [/var/www/html/site/admin-files/imagearchive/do_add.php:46]
    require_once() called at [/var/www/html/site/admin.php:165



    In Image Archive I can see that Image 88 was created but there is no thumbnail. And if I try to delete it in Image Archive it returns me an error
    The system was unable to delete the file 'images'. Please check if the user 'www-data' has permission to write to the directory '/var/www/html/site'.


    I double checked permissions and it is set to 777 (from the beginning of the installation), so that should not be the cause for this problem.

    Thanks for the help.
    br/gregaz
  • 4 Comments sorted by
  • Vote Up0Vote Down Andrey PodshivalovAndrey Podshivalov
    Posts: 1,526Member, Administrator, Sourcefabric Team
    it should be resolved by command:
    sudo chown -R www-data:www-data /var/www/html/site 
  • Hi Andrey
    Ammm... thanks for your advice, I did as you said and now all pages are blank (white), and I can't log in to Campsite. What should I do now, please help me.
  • Hi,

    Well, it depends on what user is running your web server. Andrey assumed it is www-data but it might be some other (even if running Ubuntu) and then the command does not make the trick, so please make sure who is running apache on the server and that user has write permissions on images/ directory and all inside (like images/thumbnails/ directory).

    You said 777 was set for all files and directories, in that case it should work no matter the user running apache as every user would have read, write and execution permissions for everything.

    Best,
  • Hi Holman
    Yes, I just figure that out too. The thing is that I'm running CentOS, so all I had to do was to set "Apache" as a owner of the "images" folder, and set permissions of images folder and all subfolders to "777" (I had that from the start).
    Now everything works fine.
    But still - why it worked from the start, I'm sure I didn't change anything around "images" folder???
    Thanks again both of you.
    rgd/grega