1

I am new in using Drupal.

First, I downloaded and installed a Drupal free template on my localhost. Everything works fine.

However, when I duplicated the site from localhost to sharedhost for testing, the image cannot be uploaded nor displayed in the test site when I am adding or editing contents. I went to check with the sharedhost provider, so far, it concludes that "safe mode off", and no error notice nor message is shown in the report.

I copy the reply:

"I am not sure if the paths set are the problem. I noticed your temporary directoy was set to C:/xampp/tmp and I have changed this to simply tmp for you as well as created the directory on the server with complete read/write permissions. It does not appear to have corrected the issue but will be good to have set down the road.

I beleive the issue is with the way Drupal handles image uploads. Unfortunately, it does not appear their are any error messages being generated or logged when an image is uploaded. This leads me to beleive Drupal is not attempting to generate the thumbnail instead of trying and failing.

I recommend creating a post in the Drupal forums regarding the issue. I am going to continue to investigate form here but perhaps someone on the Drupal team will have more insight into what could be causing this."

I just try to upload an image in a new content type and change an image in an existing content. The error log shows:

"[Mon Aug 19 04:44:09 2013] [error] [client 218.102.131.79] File does not exist: /home/jwbb26i2/public_html/favicon.ico"

We have no idea about this problem. Can everyone help me know or solve this problem?

Thank you very much.

2
  • There must be some kind of error, either in Drupal's watchdog or in webserver itself. If you can't access Apache's error.log or your Apache does not log errors, we can't quite help you. Standard answer is: check file permissions. But it may or may not work for you. Do your best to obtain actual error message. and what does it mean "cannot be uploaded"? What exactly happens? what's the error message, if any? – Mołot Aug 19 '13 at 11:30
  • Thank you. Molot. I think it is better to describe this problem as Cannot Display Image. When I uploaded the image, the thumbnail image shows nothing, but when I point the cursor over the image, it shows the file name. – Joseph Lau Aug 19 '13 at 11:35
3

Make sure the directory exists and write permissions are set to 777 (probably 775 on production).

Check the permissions on site/default/files . You might have to ask your shared host admin for this. If you have ssh you can do chmod 777 site/default/files.

2
  • This is my first time to build a website and a Drupal site. I know this is a problem in path or directory, but I have no idea on how and where to define and set the proper directory. Could you do me a favour to tell me in details on how to do it? Thank you very much. – Joseph Lau Aug 19 '13 at 14:14
  • In my case, the site/default/styles directory was owned by root user instead of the web server user (in my environment, the web server user is named www-data, but your environment may be different). I changed the owner of this directory to www-data ($ chown -R www-data:www-data styles), and then my thumbnail images worked. – aapierce Jul 23 '19 at 14:49
2

Go to Configuration->File System and change your files directory from the localhost diectory to sites/default/files or similar. Your theme is trying to load the file from a directory that does not exist.

6
  • "Public file system path" is "sites/default/files". If it is wrong, could you tell me how to describe the right path? Thanks again. – Joseph Lau Aug 19 '13 at 11:59
  • I am new in building website. May I ask should I add "/home/jwbb26i2/public_html/" in front of the above path? – Joseph Lau Aug 19 '13 at 12:04
  • No, it's correct. Is your temporary file system "tmp"? – deinqwertz Aug 19 '13 at 19:00
  • "Temporary directory" is "tmp" – Joseph Lau Aug 20 '13 at 3:54
  • I added a line $base_url = "mysite.com"; in settings.php file. I cleared all cache and refreshed the site. The problem still exists. – Joseph Lau Aug 20 '13 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.