News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Problem writing files

Started by sirgodnolimit, April 12, 2011, 06:16:36 PM

Previous topic - Next topic

sirgodnolimit

Hi, i've moved to a new hosting, installed SMF 2.0 RC3 like in the other host and the SMF can't write or overwrite any file.

The folder permissions are the same as the official Manual of SMF says, even i tried to set on 777 all of them but it does not work.

When i install a mod, the package manager say that everything is OK but then i download the files which should be modified and they aren't.

Only the BD modifies from the mods files take effect.

I can install and use the mods editing files manually and uploading to the FTP.

Now i tried to send emails from the forum but it doesnt send, i suppose it could be the same problem.

I wonder if its a hosting problem or if i can do anything to fix it.

Thank you in advance.








kat

Hi, God!

Welcome to the forum! ;)

First off, can you ask your host if you have full ownership of the files on your site?

It might also be worth asking them if they have mod security enabled, too.

sirgodnolimit

im asking for that.

i think security mod is enabled because i had to create the .htaccess including this code:

<IfModule mod_security.c>
   # Turn off mod_security filtering.  SMF is a big boy, it doesn't need its hands held.
   SecFilterEngine Off

   # The below probably isn't needed, but better safe than sorry.
   SecFilterScanPOST Off
</IfModule>

After that i could continue the install.

sirgodnolimit

ive written a little program to test if it writes on the ftp a file:

<?php
Print "Hello, World!";

$myFile = "testFile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "Bobby Bopper\n";
fwrite($fh, $stringData);
$stringData = "Tracy Tanner\n";
fwrite($fh, $stringData);
fclose($fh);
?>

Ive given 777 permissions to the program and it works, a file named testfile.txt is in the folder with the content.

So is the smf who isnt allowed to write files i swear.

i'll post when hosting replies the email


MrPhil

#5
Quote from: sirgodnolimit on April 13, 2011, 10:46:30 AM
ive written a little program to test if it writes on the ftp a file:
What does this have to do with FTP? It appears that you're merely writing a file to your site's filesystem.

QuoteIve given 777 permissions to the program and it works
Your host may be restricting certain permissions for security reasons. For example, if they're running suPHP, you will be denied access to (and can't run) "world writable" files. 777 and 666 permissions would be "world writable", for example, and are a security risk. Don't automatically chmod everything to 777 permissions, no matter what the obsolete SMF documentation says to do. Start out with 755 for directories and 644 for files, and add on the minimal amount of permissions needed to get the job done. That SMF can't write to files means that PHP and/or the server (e.g., Apache) may mean that either or both are running as a user ID that doesn't have write permissions. It's possible that there are some oddities in your host where special things have to be done to allow PHP and/or Apache to write to files (setuid, setgid bits).

I take it that you're on a Linux system and not Windows? You said you've done 777 permissions -- by what command? If it was via FTP, be aware that many hosts ignore chmod orders from FTP programs (you end up not actually changing permissions). Be sure to double check that permissions actually got changed. And of course, you've verified that you are the owner of all these SMF files and directories and thus have permission to chmod them and owner permissions to write to them.

sirgodnolimit


Problem solved, i asked my hosting to disable the security mod and only 1 day later they disabled it. Package manager now is able to modify what it need.

Solved this i only have a problem with sending emails but now i know that is a different problem that im asking on this topic, im going to find support on other topics for this.

Thanks for the support, very helpfull.



Advertisement: