Jump to content

Giving permissions for PHP to write in folders


arunvg

Recommended Posts

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. ???

Thanks
Arun :(
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

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.
Thanks
Arun
Link to comment
Share on other sites

friend ,
the problrm is that i have to install a project managment tool which works with PHP5.1.6 and MySQL
I 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 me

Thanks
Arun
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.