Problem with permissions install/uninstall

Started by MacX, February 13, 2012, 04:10:32 PM

Previous topic - Next topic

MacX

I have this erros when when i try to uninstall a package (mod).
http://s2.subirimagenes.com/privadas/1758484captura-de-pantalla.png

The author of the mod said me i have problems with permissions so then with package manager and not with the mod.

The log shows this kind of erros:

http://www.mysite.com/foro/index.php?action=admin;area=packages;sa=uninstall;package=ShareThis.zip;pid=12: unlink(/home/mysite/public_html/foro//Packages/temp/SMF1-1/Sources.xml) [<a href='function.unlink'>function.unlink</a>]: Permission deniedArchivo: /home/mysite/public_html/foro/Sources/Subs-Package.php
Línea: 1601

http://www.mysite.com/foro/index.php?action=admin;area=packages;sa=uninstall;package=ShareThis.zip;pid=12: unlink(/home/mysite/public_html/foro//Packages/temp/SMF2-0/Sources.xml) [<a href='function.unlink'>function.unlink</a>]: Permission deniedArchivo: /home/mysite/public_html/foro/Sources/Subs-Package.php
Línea: 1601

There are plenty of them and all in the lin Línea: 1601

I can not install or uninstall any package or mod.
I am using PHP 5.2.17 and the last version of SMF forum (2.0.2??) (i made the upgrade yesterday without erros).

As far as i know i have been with this problem for a long time ago, when i was using SMF 1.X and now it seems to still in there...

Do you guys have any idea what folders or files should i modify? Thanks.

kat

Try going to Admin>Packages>File permissions and setting that to "Standard".

If that doesn't help, ask your host to make sure that you have full ownership of the files on your site.

(CHOWN, not CHMOD)

MacX

Thanks, i have just write to them as with standard settings doesn't work as well. (when i try to uninstall the mod)

I will tell you tomorrow.


MacX

Ok, this is what they have answered me:

Quote
Probably the package you want to install in your forum requieres to write in some folder, create some folder or write on some files and it can not do it because it runs with the "nobody" username, not with your username. You will have to give 777 permissions to the folder or files where the PHP script have to write.

If you know where it gets stuck i can look at those permissions if you want.

So... what should i do then? Just change all those permissions on the folders / files manually by my own?

Thanks.

kat

That sounds like BS, to me.

Try making the file public_html/foro/Sources/Subs-Package.php read/write enabled and see what happens.

MacX

Quote from: K@ on February 14, 2012, 10:35:36 AM
That sounds like BS, to me.

Try making the file public_html/foro/Sources/Subs-Package.php read/write enabled and see what happens.
Nothing change.

What do you mean with BS?

MacX

Any idea what i can do to solve this? What about changing permissions manually?
I really need to fix it if i want to install mods...

kat

That's what I meant by

Quote from: K@ on February 14, 2012, 10:35:36 AM
Try making the file public_html/foro/Sources/Subs-Package.php read/write enabled and see what happens.

"BS"="Bull******" ;)

If that file IS read/write-enabled and you're still getting the error, that'll prove it. :)

MacX

Quote from: K@ on February 14, 2012, 01:27:14 PM
If that file IS read/write-enabled and you're still getting the error, that'll prove it. :)
I did it and i still having the same problem.
What should i prove?

Maybe i should change also the permissions on the files that give me the error in this image?

kat

Quote from: K@ on February 13, 2012, 04:17:55 PM
Try going to Admin>Packages>File permissions and setting that to "Standard".

Doing that should do it, anyway.

That's why I suspect your host's talking crap. ;)

MacX

Quote from: K@ on February 14, 2012, 01:54:08 PM
Quote from: K@ on February 13, 2012, 04:17:55 PM
Try going to Admin>Packages>File permissions and setting that to "Standard".

Doing that should do it, anyway.

That's why I suspect your host's talking crap. ;)

It didn't work anyway.

I have  tried to change permisions manually to 777 , ( for example, of the sources/display.php where it gives the error) and nothing changes, it continues giving the same error.

By the way, when i look at the logs i find out that there are lines like this one:
http://www.mysite.com/foro/index.php?action=admin;area=packages;sa=uninstall;package=ShareThis.zip;pid=12: unlink(/home/mysite/public_html/foro//Packages/temp/SMF1-1/BoardsAndTopics.xml) [<a href='function.unlink'>function.unlink</a>]: Permission deniedArchivo: /home/mysite/public_html/foro/Sources/Subs-Package.php
Línea: 1601

Referring to SMF-1-1...

Why is this? It occurs when i try to unistal another package of SMF-2.0... i dont know why it looks at SMF-1-1 and gives errors with all the packages i had on previous versions of the forum...

MrPhil

Are you using FTP to change permissions? Many servers are configured to ignore chmod requests from FTP. You will need to use your hosting service control panel. Are you on a Windows or a Linux server? Linux uses 777 style; Windows has a different permissions model. (From the error messages, it looks like a Linux server.) The bottom line is that PHP has to be able to write to specific directories, which could be 755, 775, or even 777 permissions, depending on how your server is set up. Don't blindly set permissions to 777 -- do it only if your host advises that is the correct setting for an application to write files into a directory, or you've ruled out 755 and 775 as not working. Some servers even forbid 777 (you get a 500 error trying to access that directory) because it's a security hazard (another user on your server may be able write to it).

I also see // in your file paths for the unlinik() call... that shouldn't be -- there is an extra / at the beginning or end of some path data, that produces a double / when concatenated. Finally, check that the SMF2-0 directory under "temp" is also writable (not just "temp"). Maybe that's a problem.

MacX

Quote from: MrPhil on February 15, 2012, 09:56:11 AM
Are you using FTP to change permissions? Many servers are configured to ignore chmod requests from FTP. You will need to use your hosting service control panel. Are you on a Windows or a Linux server? Linux uses 777 style; Windows has a different permissions model. (From the error messages, it looks like a Linux server.) The bottom line is that PHP has to be able to write to specific directories, which could be 755, 775, or even 777 permissions, depending on how your server is set up. Don't blindly set permissions to 777 -- do it only if your host advises that is the correct setting for an application to write files into a directory, or you've ruled out 755 and 775 as not working. Some servers even forbid 777 (you get a 500 error trying to access that directory) because it's a security hazard (another user on your server may be able write to it).

I also see // in your file paths for the unlinik() call... that shouldn't be -- there is an extra / at the beginning or end of some path data, that produces a double / when concatenated. Finally, check that the SMF2-0 directory under "temp" is also writable (not just "temp"). Maybe that's a problem.
Thanks for the reply but it was not that.

I checked permissions through cpanel and my ftp allows me to change them because they were set to 777 like i set them before.
I am very happy with this hosting service and they offer a very good service in many fields.  I asked them about this problem more than 2 years ago and i didn't get the solution.

The server runs with Apache so permissions have to be set at 777.

I dont know what could it be. It's true that there's a double / on the path but at url's i think it is not a big deal. Anyway, i have changed it. So now i have this error:

http://www.mysite.com/foro/index.php?action=admin;area=packages;sa=uninstall;package=ShareThis.zip;pid=12: unlink(/home/mysite/public_html/foro/Packages/temp/SMF1-1/BoardsAndTopics.xml) [<a href='function.unlink'>function.unlink</a>]: Permission deniedArchivo: /home/mysite/public_html/foro/Sources/Subs-Package.php
Línea: 1601

Permissions ar set like this:
Packages: 777
temp: 777
SMF1-1: 777
BoardsAndTopics.xml: 777

Anyway, why is it looking at files form old packages of SMF1-1 when i am just trying to uninstall a mod package of SMF2-2 version?

MacX

Ok, i have just solved the LOG problem. Not the main one ;)
I changed  permises of SMF1-1 trough the cpanel as you told me. (i think the FTP didn't have the last version of those files as it doesn't refresh everytime...)

Ok, i dont have any problem with the log now, it is completely empty :)
BUT, the problem trying to uninstall the mod stills there. Same screen as the one i posted previously and NO log erros.


¿any idea?

kat

That still screams "CHOWN", at me.

Has your host got "mod_security" enabled?

Of so, can you ask them to disable it?

One other thought springs to mind. Do you happen to have PrettyURLs installed?

MacX

Quote from: K@ on February 15, 2012, 12:24:53 PM
Has your host got "mod_security" enabled?
Yeah, mod_security2 is loaded.
Quote from: K@ on February 15, 2012, 12:24:53 PM
Of so, can you ask them to disable it?
Is it so rare to have it loaded? Isn't it a way to protect the hosting?

Quote from: K@ on February 15, 2012, 12:24:53 PM
One other thought springs to mind. Do you happen to have PrettyURLs installed?
You mean, mod_rewrite of PHP? I have it.
I installed PrettyURLs for my forum in SMF1-1 for some time. Then i uninstalled it when i was SMF 1.X. So it is not working anymore.

kat

Phew. I've known that mod cause hassles, like this.

mod_security is pretty basic, really.

This explains it far better than I can.

http://help.joyent.com/index.php?pg=kb.page&id=85

I have it disabled on all my sites and never had any problems, at all.

Advertisement: