I searched all over the internet...Googling it from last night in very confusion. Not a single confirmed solution..

Here is the error message me and my members get when uploading an avatar to the website->

* The selected file /home/creativ1/public_html/xxxxxx.info/files/tmp/tmp_5rGEF4 could not be uploaded, because the destination is not properly configured.
* Failed to upload the picture image; the directory doesn't exist or is not writable.

It was working last night, suddenly stopped.
It is writable and destination is perfectly configured. Of course it does exist and CHMOD 777

Please I need help....

Comments

cog.rusty’s picture

Run a phpinfo() in Drupal (see http://drupal.org/node/59680) and check:
- Is there any mention of safe_mode or open_basedir with a path?
- What is php's upload_tmp_dir?

Also, examine the public_html/xxxxxx.info/files/tmp directory.
- Is the path right? Or is it, for example, sites/xxxxxx.info/files/tmp?
- You are saying it is 777? Who is its owner?

Johnson2’s picture

Hello sir,
here is the information you needed to find a solution for my problem-

safe_mode Off
upload_tmp_dir no value

- Is the path right? Or is it, for example, sites/xxxxxx.info/files/tmp?
Path is right, last time it worked great, but as I stated suddenly it stopped.

- You are saying it is 777? Who is its owner?
i just checked that files do upload to the server. in files/tmp

but their mod is 644 and when I try to change it

- Command: SITE CHMOD 775 tmp_tCDGY6
Response: 550 Could not change perms on tmp_tCDGY6: Operation not permitted

the .htaccess file in the same directory is behaving the same way.

Command: SITE CHMOD 775 tmp_tCDGY6
Response: 550 Could not change perms on tmp_tCDGY6: Operation not permitted

I don't know how to fix it, please help me and thanks in advance.

cog.rusty’s picture

You can't chmod those files with FTP because they were created by Drupal, so their owner is the web server account (apache) and not your own user account. But you don't need to chmod the files. Apache should be able to write them fine if it is the owner and they are 644. Anyway, Drupal is going to create more of them, so there is no point.

What is important is to make the *directories* files and files/tmp writable by the web server. Can you chmod them both to 777?

If you can't chmod one of these directories using FTP (because it was created by Drupal and its owner is apache), then you must delete it, create it again with FTP so that you own it, and then chmod it to 777.

If you can't delete a directory using FTP (again, because you are not its owner), then you could try to delete it with a php script, or try your cpanel's file manager, or ask your host tech support to delete it for you. Then create it again yourself with FTP and chmod it to 777.

Johnson2’s picture

files and files/tmp both are writable by the web server and I can chmod it to 777. Still not working.

cog.rusty’s picture

What Drupal version? Is there any error message when you visit the admin/reports/status (Drupal 6) or admin/logs/status (Drupal 5) page?

In the admin/settings/file-system page, what are your files and temp paths? Public download method?

cog.rusty’s picture

Not sure how important this is, but notice how http://api.drupal.org/api/function/file_copy/5 should display the destination directory name in the error message "because the destination %directory is not properly configured", which in your case comes empty.

One difference that I can see when comparing your screenshots with a working 5.12 installation of mine is that I have a files/pictures directory (set to 777) for the user images, which is specified in the admin/user/settings page as pictures.

Another difference is that I have created a temp directory for PHP, /home/account-name/tmp and specified it in a php.ini file with an upload_tmp_dir = /home/account-name/tmp line (also set to 777).

Johnson2’s picture

Sir, I have created tmp directory and set to 777

/home/creativ1/tmp

But how can I put it in the php.ini

or how can I set it up so upload_tmp_dir value would be /home/creativ1/tmp

I mean where in the phpmyadmin should I find and put this value.

Thank you very much for helping me. I hope it will get fixed.

cog.rusty’s picture

So, creating a directory for the pictures in admin/user/settings didn't work?

Normally, to set PHP's tmp directory you need to edit PHP's configuration file, php.ini. On shared hosts, where you can't edit that file, usually you can make a copy of the server's php.ini file in your drupal directory and add the upload_tmp_dir = /home/creativ1/tmp line at the end.

Usually you can find the php.ini file in /usr/lib/php.ini or in /usr/bin/php/php.ini or in /usr/local/lib/php.ini or in /usr/local/bin/php/php.ini or in /usr/local/Zend/etc/php.ini or... Maybe phpinfo() can tell you where it is, or you can ask your host.

dewolfe001’s picture

I had to use chmod to set the permissions to 755. But this didn't work until I did a chown to match the rest of the permissions for example:

chown www.root files/pictures
chown www.root files/pictures/tmp

(chown needing a group and user)