PDA

View Full Version : permissions for php.ini



zestgourmet
02-16-2005, 04:40 PM
what should the permissions be set to for the php.ini file?

torrin
02-16-2005, 04:47 PM
Mine is set to 644.

wildjokerdesign
02-16-2005, 04:48 PM
-rw-rw-r--
644

zestgourmet
02-16-2005, 04:52 PM
Do you know how I can set this? I was making a change to my php.ini file and now the permission is 777. I'm using FileZilla to change the permissions, but it isn't working.

torrin
02-16-2005, 05:01 PM
I'd log in using ssh, cd to the directory and issue the command . . .

chmod 644 php.ini
Maybe I should ask, are you changing the mode of a soft link to php.ini or the actual file. I'm not sure you can change mode on a soft link.

wildjokerdesign
02-16-2005, 05:04 PM
I use WS_FTP Pro so can't say for sure how you do it with FileZilla. In my program I simply right click to get the menu that has chmod(UNIX) then enter what I want and hit OK. If I can find out more about FileZilla I'll let you know.

wildjokerdesign
02-16-2005, 05:04 PM
Ok Torrin seems to be faster then I am :)

wildjokerdesign
02-16-2005, 05:05 PM
That is right as Torrin mentioned you need to be changeing premmisions on the file you see in /ftp/usr/lib.

zestgourmet
02-16-2005, 05:15 PM
that's one of the problems I'm having... my php.ini file is not in the ftp/usr/lib/ directory. it is in the /etc/ directory.

also, i confess i don't know how to ssh. :oops:

wildjokerdesign
02-16-2005, 05:20 PM
The php.ini that you see in the /ect/ directory is a soft link to the one in /ftp/usr/lib. You need to go to that directory to change permissions.

wildjokerdesign
02-16-2005, 05:25 PM
I just tried to change permissions on mine and it would not work so even if you get there you most likely are not going to be able to change the premissions. Must be because it is owned by Root. Looks like we may have to lead you through SSH.

First let me check if I can even do it in an SSH session and see if I can find the link to the manual where you can get the info on downloading putty.

zestgourmet
02-16-2005, 05:26 PM
I was wondering about that. But, when I go to ftp/usr/lib the php.ini file is not in that directory... or, I can't see it. I've tried in both filezilla and in our site manager/file manager.

wildjokerdesign
02-16-2005, 05:28 PM
Nope you don't have access to change permissions in SSH either. How did you get it set to 777?

wildjokerdesign
02-16-2005, 05:30 PM
The icon for it should look different then the one in /ect. On my program is is the last one listed at the very bottom. That is without me sorting the files and using the default.

zestgourmet
02-16-2005, 05:35 PM
I went to /etc/php.ini/php.ini. I backed up the file by renaming it to php.ini.bak. Then I edited my copy and used filezilla to upload the file. The newly uploaded copy was 777. I was worried about the new permission setting, so i renamed the new php.ini file to php.ini.old and renamed the php.ini.bak to php.ini. Unfortunately, when I did this the file permissions for php.ini was 777 again.

My site, www.zestgourmet.com, is working fine, but I'm worried about security.

P.S. I just want to thank wild joker and torrin... you two have always been a big help in the few years that I have been with WestHost. I haven't always worked with you directly, but I have gained a lot from your posts. Thanks!

torrin
02-16-2005, 05:38 PM
It's actually in /usr/lib. Here is a session where I checked.

[torrin][/usr/lib]$ ls -l /etc/php.ini
lrwxrwxrwx 1 root root 24 Feb 5 21:30 /etc/php.ini -> ../usr/local/lib/php.ini
[torrin][/usr/lib]$ ls -l /usr/local/lib/php.ini
lrwxrwxrwx 1 root root 17 Feb 5 21:30 /usr/local/lib/php.ini -> ../../lib/php.ini
[torrin][/usr/lib]$ ls -l /usr/lib/php.ini
-rw-r--r-- 1 torrin vuser 41181 Feb 5 21:30 /usr/lib/php.ini
[torrin][/usr/lib]$
AFAIK, you should have permission to change the one in /usr/lib/php.ini. Once you get into ssh, the command is . . .

chmod 644 /usr/lib/php.ini
I'm working on some instructions to get ssh up and running.

wildjokerdesign
02-16-2005, 05:48 PM
Strange that it changed the premissions when you did that. You might ask WH support about it. I am pretty sure I have edited the php.ini the way you did in the past by downloading and uploading and not had it do that. I pretty much use SSH now.

That is really strange Torrin. My /usr/lib is a link to /ftp/usr/lib

lrwxrwxrwx 1 root root 14 Nov 4 23:41 lib -> ../ftp/usr/lib

zestgourmet
02-16-2005, 06:24 PM
strange... i just used ws_ftp32 and was able to see my php.ini file in ftp/usr/lib for the firtst time, and it has the correct permissions???

anyway, i guess problem solved... thanks to both of you!

wildjokerdesign
02-16-2005, 08:23 PM
Glad you got it worked out. Let use know if you have any other problems.

torrin
02-16-2005, 09:28 PM
That is really strange Torrin. My /usr/lib is a link to /ftp/usr/lib

lrwxrwxrwx 1 root root 14 Nov 4 23:41 lib -> ../ftp/usr/lib

Oops, you're right. My /usr/lib is also linked to /ftp/usr/lib. :) Thanks for the correction.