twilitegxa Posted June 26, 2009 Share Posted June 26, 2009 Can anyone tell me how to set permissions on PHP files? I have been told to set the permissions on a php file to 677. I have no clue how to do this. Can someone please explain to me how to do it? Quote Link to comment Share on other sites More sharing options...
Andy-H Posted June 26, 2009 Share Posted June 26, 2009 http://php.net/chmod $path = "path/to/file.php"; if ( chmod($path, 0677) === TRUE ) { echo 'File permissions sucessfully set for file ' . $path . '.'; } else { echo 'Couldn\'t update file permissions for file: ' . $path . '.'; } Quote Link to comment Share on other sites More sharing options...
SetToLoki Posted June 26, 2009 Share Posted June 26, 2009 Can anyone tell me how to set permissions on PHP files? I have been told to set the permissions on a php file to 677. I have no clue how to do this. Can someone please explain to me how to do it? if your files are stored on a linux server you can ftp or ssh into your server and change the file write options. ie if you were changing a folder and all sub catagories on linux you would ssh in and type # chmod -R 677 foldername in ftp you depending on your client usually right clcik and set file permissions and then type in 677 in the box. or if you are creating the files using php and you have the correct permission to do so you could use the php function chmod http://uk2.php.net/chmod Quote Link to comment Share on other sites More sharing options...
natepizzle Posted June 26, 2009 Share Posted June 26, 2009 If you have ftp access to the files in question you can right click the file in most ftp programs and change permissions. Quote Link to comment Share on other sites More sharing options...
twilitegxa Posted June 26, 2009 Author Share Posted June 26, 2009 I do have an FTP program, FileZilla, but it does not seem to have a way to change the mode on the files. Or at least not that I have found. :-( I am using WAMP Server on my localhost. The files have already been created, but could I alter the php files and include the php chmod function to change the mode manually? What would be the best way to do this? I am trying to learn how to use osCommerce and that is where I have run into the "change permission" dilemma. In the PDF documentation on how to use it, it tells you to change the permissions, but I don't know how. :-( In FileZilla, when I right-click, there is no option to set the file permissions. Quote Link to comment Share on other sites More sharing options...
SetToLoki Posted June 27, 2009 Share Posted June 27, 2009 I do have an FTP program, FileZilla, but it does not seem to have a way to change the mode on the files. Or at least not that I have found. :-( I am using WAMP Server on my localhost. The files have already been created, but could I alter the php files and include the php chmod function to change the mode manually? What would be the best way to do this? I am trying to learn how to use osCommerce and that is where I have run into the "change permission" dilemma. In the PDF documentation on how to use it, it tells you to change the permissions, but I don't know how. :-( In FileZilla, when I right-click, there is no option to set the file permissions. http://www.tech-evangelist.com/2007/07/15/filezilla-tips/ Quote Link to comment Share on other sites More sharing options...
natepizzle Posted June 27, 2009 Share Posted June 27, 2009 are you on windows, *nix, or a [choke] mac [/choke] Quote Link to comment Share on other sites More sharing options...
SetToLoki Posted June 27, 2009 Share Posted June 27, 2009 are you on windows, *nix, or a [choke] mac [/choke] just a quick tip, if you are testing locally it is usually better to install a virtual machine running linux I pick ubuntu server and use that as my web server even though it remains local, simply because you might find php acts differently on a windows machine than it does on a linux one and most hosting companies will use a linux machine. Quote Link to comment Share on other sites More sharing options...
twilitegxa Posted June 27, 2009 Author Share Posted June 27, 2009 I'm running Windows XP, but in my FileZilla, the option for File Attributes is not available. :-( I'm trying ti install ubuntu now. We'll see how hard it is for me to use. :-) Quote Link to comment Share on other sites More sharing options...
SetToLoki Posted June 27, 2009 Share Posted June 27, 2009 I'm running Windows XP, but in my FileZilla, the option for File Attributes is not available. :-( I'm trying ti install ubuntu now. We'll see how hard it is for me to use. :-) if you have never used linux before I would put on a pot of coffee on the upside ubuntu will ask what you want to install when you get to end of installation you need lamp and the database also ssh can use downlaod and use putty from your windows machine then to connect to ubuntu server. should be able to sudo apt-get install filezilla server I think if not grab vsftpd is the one I use and seem to do the job just fine sudo apt-get install vsftpd will get and install it for you then you will have to edit the conf file a quick google search will show you the answer, when asked to edit a file in ubuntu I always use vi so sudo vi etc/vsftpd/vsftpd.conf or something like that.. anyway good luck too you if you hgave trouble send me a message and will if I am still awake help you out Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted June 27, 2009 Share Posted June 27, 2009 I'm running Windows XP, but in my FileZilla, the option for File Attributes is not available. :-( I'm trying ti install ubuntu now. We'll see how hard it is for me to use. :-) I don't think the question was meant toward your computer, but your server. Quote Link to comment Share on other sites More sharing options...
SetToLoki Posted June 27, 2009 Share Posted June 27, 2009 I'm running Windows XP, but in my FileZilla, the option for File Attributes is not available. :-( I'm trying ti install ubuntu now. We'll see how hard it is for me to use. :-) I don't think the question was meant toward your computer, but your server. oh god, hope you haven't formatted a windows installation for ubuntu - linux is great for servers but as a OS for your on pc, nobody deserves that much of a headache when they want to perform simple tasks Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted June 27, 2009 Share Posted June 27, 2009 oh god, hope you haven't formatted a windows installation for ubuntu - linux is great for servers but as a OS for your on pc, nobody deserves that much of a headache when they want to perform simple tasks What's wrong with Linux OS? Quote Link to comment Share on other sites More sharing options...
SetToLoki Posted June 27, 2009 Share Posted June 27, 2009 oh god, hope you haven't formatted a windows installation for ubuntu - linux is great for servers but as a OS for your on pc, nobody deserves that much of a headache when they want to perform simple tasks What's wrong with Linux OS? if I wasn't brought up with the ease of windows nothing but as everything has been made so easy for me since the release of windows 3.1 all them years ago (was a dos monkey for a bit) I am now far far to lazy to use linux - don't have to remember functions and such in windows I just click things till it works and if it doesn't work I just have to click harder and faster! Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted June 27, 2009 Share Posted June 27, 2009 in windows I just click things till it works and if it doesn't work I just have to click harder and faster! And that folks is the understatement of the decade. Quote Link to comment Share on other sites More sharing options...
twilitegxa Posted June 28, 2009 Author Share Posted June 28, 2009 I don't really want to use ubuntu as my OS, so I'll just stick with Windows. Quote Link to comment Share on other sites More sharing options...
SetToLoki Posted June 29, 2009 Share Posted June 29, 2009 you could I don't really want to use ubuntu as my OS, so I'll just stick with Windows. use VMWARE to set up a virtual host on your windows machine Quote Link to comment Share on other sites More sharing options...
MadTechie Posted June 29, 2009 Share Posted June 29, 2009 In FileZilla, connect to the server, right click on the file or folder select "File Attributes" you can change the permission from their The permission only affect *nix system, just ignore them for windows Quote Link to comment Share on other sites More sharing options...
twilitegxa Posted July 1, 2009 Author Share Posted July 1, 2009 I don't get that File Attributes option for some reason... :-( Quote Link to comment Share on other sites More sharing options...
MadTechie Posted July 4, 2009 Share Posted July 4, 2009 You don't get it? as its greyed out or doesn't appear ? either your connected to a windows OS or have an old version of FileZilla, (you are right clicking on the files on the server correct) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.