Hello all,

Finally got Drupal running (up to a certain point)

I just have to get rid of these errors:

warning: is_file(): Stat failed for /upload_tmp/.htaccess (errno=13 - Permission denied) in /mounted-storage/home23b/sub003/sc21824-ITBD/www/Drupal/includes/file.inc on line 115.

warning: fopen(/upload_tmp/.htaccess): failed to open stream: Permission denied in /mounted-storage/home23b/sub003/sc21824-ITBD/www/Drupal/includes/file.inc on line 117.

Security warning: Couldn't write .htaccess file. Please create a .htaccess file in your /upload_tmp directory which contains the following lines:
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Options None

RewriteEngine off

I have searched the forums and http://drupal.org/node/67623 is exactly the same problems. I have created the right directories and given them the correct permissions (full write access) but I still receive these errors. Can anyone help me find out what is causing these errors ?

Thank you!

Comments

splash112’s picture

hi DuxOr,

Does your webhoster allow you to make .htaccess files?
It doesn't really look like a Drupal problem. Please check for the right versions of apache and php.

Good luck!

dux0r’s picture

I've enabled .htaccess settings on my webhoster. I've created the .htaccess file and uploaded it with no trouble

My webhoster is running the correct versions of apache and php

Still can't access the directories and get the same errors!

Thanks!

splash112’s picture

Some other suggestion from:
http://cn2.php.net/manual/en/function.fopen.php

Could you check if php runs in safe-mode? If so, the directory and process will have a different owner (directory - you, process - system)

Hope this helps...

splash112’s picture

btw

what do you mean by can't access the catagories?

With a browser / ftpclient / shell?

Thanks

dux0r’s picture

Hi,

I've disabled PHP safe mode but PHP Safe Mode GID is still on, I'm not sure what this means.... should I turn that off too ?

.htaccess settings have been enabled also.

I can access all directories via ftp, but I can't change/upload files to these directoies via ftp. I can change and upload files etc through my webhosters control panel's "Online Filemanager". Not sure why this is...

Through Drupal (using the browser) I keep getting errors (in the administer tab) like this :

security 07/20/2006 - 14:55 Security warning: Couldn't write .htaccess file. Please ...
php 07/20/2006 - 14:55 fopen(/upload_tmp/.htaccess): failed to open stream: ...
php 07/20/2006 - 14:55 is_file(): Stat failed for /upload_tmp/.htaccess ...
security 07/20/2006 - 14:52 Security warning: Couldn't write .htaccess file. Please ...
php 07/20/2006 - 14:52 fopen(/upload_tmp/.htaccess): failed to open stream: ...
php 07/20/2006 - 14:52 is_file(): Stat failed for /upload_tmp/.htaccess ...

So whenever I try and do some operation it has one of those errors in the error log.

Thanks!

splash112’s picture

Hi Dux0r

My best guess would be that you made the directories in the control panel and that those directories have now another User ID than your files/scripts. Try to delete them (with the control panel) and make them with your ftp client. Then try to run the scripts again...

Good luck

dux0r’s picture

I've deleted the upload_tmp directory with the control panel. I then tried to make this same directory with the ftp client but it says operation not permitted

I can't even change the permissions on the root Drupal directory, it says operation not permitted

Do you know why this is ?

Thanks!

splash112’s picture

Ok, I think I miss something.

Could you explain how you got the other directories and files in place? Did you do an upload via FTP or with the control panel?

Thanks

dux0r’s picture

What I did was upload the drupal.tar.gz file via ftp, then used the control panel to unzip it all because it was quicker to do that then ftp each single file and dir when it was unzipped. Maybe this is the wrong way to do it? Has the wrong user been assigned as the owner of the whole drupal directory and all the files within it? Maybe thats whats happening.

I created the "files" directory and "upload_tmp" and .htaccess file with the control panel because it wouldnt allow me to do it via ftp. It said operation not permitted even though I assigned ALL permissions (777) via the control panel to these files and dirs

Maybe thats why drupal can't access the .htaccess file or the /upload_tmp dir?

I'm not sure

Thanks for taking the time to try to help :)

splash112’s picture

You are welcome :) but it is still not working

Maybe you could check your ftp client for the permissions of your files and directories. It's very strange (and probably incorrect) that your admin panel says everything is 777 and you still lack permission to add a folder.
If it's not too much trouble I would really advise you to empty and delete your folders and start over again. Unzip the files on your dekstop, alter where necessary and upload by ftp. With a normal ftp client and a good internet connection it wouldn't take to long...

Hope it helps...

dux0r’s picture

Maybe I'll just start again I guess :( and then let you know how it goes

If not tonight (it's getting late here) then tomorrow and I'll post again with the result

*sigh!*

aw-1’s picture

Just a guess, but the error message says:

warning: is_file(): Stat failed for /upload_tmp/.htaccess (errno=13 - Permission denied) in /mounted-storage/home23b/sub003/sc21824-ITBD/www/Drupal/includes/file.inc on line 115.

Notice the bold part. My interpretation is:
PHP tries to open the directory just below the root directory of the server. Instead of /upload_tmp it should contain either the full path to your home dir. Or you can use a relative path: "./upload_tmp" in your settings (simply upload_tmp without any slashes might do it as well).

dux0r’s picture

I've started again, recreated the database, unzipped the tar.gz file again, and have given access to the upload_tmp directory and the .htaccess and I still get the same error.

I haven't used the control panel at all, all operations have been done through an ftp client

I'm all out of ideas.

Sorry aw, I'm not sure how to "use a relative path: "./upload_tmp" etc" with my ftp client. What I did was create the upload_tmp dir using the Make Folder option with no slashes.....

Someone help I'm going crazy here!

Thanks
dux0r

aw-1’s picture

Check your Drupal settings (admin/settings), especially the "file system path" and "temporary directory". What are the settings? Are there leading slashes in front? And can you tell the location of these directories on the server, their owners and access permissions?

Don't upload or create any .htaccess files manually. Drupal will do that for you and might fail if they already exist.

Read something about absolute and relative paths: http://en.wikipedia.org/wiki/Path_%28computing%29.

dux0r’s picture

Thanks a lot aw,

I took away the slash in front of the upload_tmp dir, and everything *seemed* to work ok, no more errors, no more security warnings, and even though I created the .htaccess file myself (as per the error message told me to do so) it seems to all work fine. I'm writing this post about 5 mins after I made the change, so haven't had time to test yet, but it all seems to be ok

Thank you very much to yourself and splash for helping me out on this one

Cheers!

dux0r

splash112’s picture

Well done Dux0r!

Great you got it to work. I wish you a lot of fun on building your site. Can't wait to see some advice on traveling to Europe (I'm Dutch...).

I hope all your problems are solved now, but I would like you to do one more small test. Could you try to upload a file through the Drupal admin panel? Like a new logo in admin / themes / settings / bluemarine / upload logo?
I wouldn't want you to be stuck with the same problem when you install a simple module as image.

Good luck!

dux0r’s picture

Hi, splash112

Thanks for the encouragement ! Yep, I'm trying to build a site with great information about Europe and where all the best places are to stay :) It won't have sales of flights or car hire or anything (not yet but who knows in the future) Just good information and focusing on people's experience so everyone can gain from our members knowledge with social interaction elements added as well like instant messaging, email, forums, gallaries and custom user profile pages and buddy lists.

I did upload an image for my favicon and ran into more problems there. It worked fine in Firefox but not in IE ! Ohhh the pain of it all :-P

But yes, uploading does work and it goes to the right place, it was that darn slash at the front of upload_tmp

Thanks for all your help

splash112

splash112’s picture

Hi Dux0r

Don't worry about the favicon. Only Firefox displays it always, IE will only display if bookmarked. Maybe the next IE will support favicons more?

Sounds like a nice site! Hope you get it all working,

Good luck!

dux0r’s picture

Silly IE

I tried bookmarking it, and then loading it from the bookmarked link, still no go!

Oh well, I've currently run into a brick wall with the design aspect. I want to theme my site and make it look awesome but then I realized you need CSS, PHP and design skills haha. Bugger eh?

So I'm currently trying to soak up as many CSS and PHP tutorials like a sponge :-P

dux0r

andydev’s picture

I got stucked with this too.
I think the problem is that drupal adds a / in front of the path (that's the default value)
Maybe it should change

tstoeckler’s picture

Hi,
I just read this thread and had the same problem as Dux0r. When I changed the directory as Dux0r did, it instantly worked.
So I just wanted to say thanks for that great advice, I had been fumbling around with that problem for weeks.