arunvg Posted August 30, 2006 Share Posted August 30, 2006 Hi Friends,I am using [color=orange][color=blue]PHP5.1.6 with MYSQL5.0 and IIS6.0 (Windows 2003 Server)[/color][/color]as an environment for my project managament tool.I have got some error in uploading files to that tool.I was advised to check whether the folders have permissions for PHP to write into it.I have given the permission to folders (Properties-> Checking the column for "Write"). but it is still not working. Is there any other methods to give permissions for PHP to write into that folders.Pls help me. ???ThanksArun :( Quote Link to comment Share on other sites More sharing options...
ScottRiley Posted August 30, 2006 Share Posted August 30, 2006 If you'#re creating a file using fopen, you need to include "w+" e.g. to create the file "newfile.txt" use [code]<? fopen("newfile.txt", "w+"); ?>[/code] Quote Link to comment Share on other sites More sharing options...
arunvg Posted August 31, 2006 Author Share Posted August 31, 2006 Thank you for your reply :).The problem is that we have some existing folders and we have to give permissions for them.Can u give any suggestions.ThanksArun Quote Link to comment Share on other sites More sharing options...
arunvg Posted September 1, 2006 Author Share Posted September 1, 2006 Hi friend,If someone knows about this problem pls help me. ??? Quote Link to comment Share on other sites More sharing options...
JayBachatero Posted September 1, 2006 Share Posted September 1, 2006 Do you mean CHMOD? If so you can use chmod('file path', permission ie 0777).chmod('/opt/lampp/htdocs/hello/', 0777). Sometimes this wont work on some servers so you have to use FTP to CHMOD it.You can do something like this for FTP CHMOD[code]<?php //Let's check if file is NOT writeable. if (!is_writeable($file)) { //Connect to FTP and login $ftp_connect = ftp_connect($ftp_url); if (!$ftp_connect) die('Can\'t connect'); $ftp_login = ftp_login($ftp_connect, $ftp_user, $ftp_pass); if(!$ftp_login) die('Can\'t login'); //FTP CHMOD if (!ftp_site($ftp_connect, 'CHMOD 0777' . $file)) ftp_site($ftp_connect, 'CHMOD 0755' . $file); else echo 'File not writeable'; //FTP close connection ftp_close($ftp_connect); }?>[/code] Quote Link to comment Share on other sites More sharing options...
arunvg Posted September 1, 2006 Author Share Posted September 1, 2006 thank you for the reply.The problem is that i am using a software which is to be used with Windows 2003 Server and IIS.How can I change the permissions setting using the above code givenThanksArun Quote Link to comment Share on other sites More sharing options...
redarrow Posted September 1, 2006 Share Posted September 1, 2006 as posted<? fopen("newfile.txt", "w+"); ?>if you are the owner of the windows meachine then use the folder options ok.this is not a php issue this is a windows 2003 issue ok. Quote Link to comment Share on other sites More sharing options...
arunvg Posted September 1, 2006 Author Share Posted September 1, 2006 I have set permissions for all the folders which PHP has to write (i.e. were the tool has to upload files)but its still not working. If these are stupid questions, pls forgive becoz i am very new to this fieldThanksArun Quote Link to comment Share on other sites More sharing options...
redarrow Posted September 1, 2006 Share Posted September 1, 2006 try this way then<? fopen("newfile.txt", "a+"); ?> Quote Link to comment Share on other sites More sharing options...
arunvg Posted September 1, 2006 Author Share Posted September 1, 2006 Can u please tell were this code have to be writen.thanks Arun Quote Link to comment Share on other sites More sharing options...
redarrow Posted September 1, 2006 Share Posted September 1, 2006 i want you to make a folder in the htdocs and call it test then i want you to goto test.php what should have the code here in ok.when you goto test.php there should be a file made as newfile.txt try.test.php[code]<?fopen("newfile.txt", "w+");?>[/code] Quote Link to comment Share on other sites More sharing options...
arunvg Posted September 1, 2006 Author Share Posted September 1, 2006 Hi friend,I have tried what u have told.I have placed the code in test.php and and placed that file in the home directory of my test sit( i am using IIS6.0) then i tried to run from there but there is nothing shown as an output also no file is created .I have tried another php code which simply echos some text it is working.Can you pls identify the problem.ThanksArun Quote Link to comment Share on other sites More sharing options...
redarrow Posted September 1, 2006 Share Posted September 1, 2006 try agin with the letter a+ Quote Link to comment Share on other sites More sharing options...
arunvg Posted September 1, 2006 Author Share Posted September 1, 2006 I tried with that also i can't see any file createdIs this some problem with php settingsThanksArun Quote Link to comment Share on other sites More sharing options...
arunvg Posted September 1, 2006 Author Share Posted September 1, 2006 sorry yar it is working the problem was that the code shld be added with<?php....?> instead of <?...............?>Now can u help me Quote Link to comment Share on other sites More sharing options...
redarrow Posted September 1, 2006 Share Posted September 1, 2006 you got it to work now so what is it you need help with mate. Quote Link to comment Share on other sites More sharing options...
arunvg Posted September 1, 2006 Author Share Posted September 1, 2006 friend , the problrm is that i have to install a project managment tool which works with PHP5.1.6 and MySQLI installed it properly.Now when i use it to upload documents, the it is not uplading properly, but no error message is shown.I contacted the program vendors and they told that give the folders permissions for PHP to write into it.Hope u now understand my problem.I tried giving permissions for the folders to be writable using the Windows 2003 .is there any other permissions to be set for PHP.plz help meThanksArun 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.