Jump to content

changeing a directory on the server to be writable


truegilly

Recommended Posts

To make a folder writeable you don't edit the php.ini instead you have to change the CHMOD permissions on the specified folder.

 

You can do this within your script using the chmod function (temporary permissions) or you can use an FTP client (permanent permissions).

 

You only need to use chmod on *nix based OS's. Windows does not use chmod for file permissions.

Link to comment
Share on other sites

ok, thanks for that,

 

my problem is that the directory that will store my images once they are uploaded constantly states that its not writable.

Ive used the is_writable() function to check this.

 

<?php
if (is_writable("/home/httpd/vhosts/clearblueseas.com/httpdocs/clearblueseas_admin/inc/img/temp")) {
    echo "is_writable";
} else {
    echo "not writable";
}
?>

 

The problem i have is that i keep getting the following error when i try and put uploaded images into the directory. the image i have uploaded is dogs.jpg

 

Warning: imagejpeg(): Unable to open '/home/httpd/vhosts/clearblueseas.com/httpdocs/clearblueseas_admin/inc/img/temp/dogs.jpg' for writing in /home/httpd/vhosts/clearblueseas.com/httpdocs/clearblueseas_admin/inc/functions.php on line 44.

 

i have uploaded another post previous to this that states the issue in more detail - http://www.phpfreaks.com/forums/index.php/topic,153744.0.html

 

any help is much appriciated !!!

 

truegilly  :D

Link to comment
Share on other sites

yeah thanks for that but i forgot to mention that ive tried that and this is what i got back....

 

<?php

Warning: chmod(): Operation not permitted in /home/httpd/vhosts/clearblueseas.com/httpdocs/clearblueseas_admin/inc/property/photos.php on line 17

// Everything for owner, read and execute for others
chmod("/home/httpd/vhosts/clearblueseas.com/httpdocs/clearblueseas_admin/inc/img/temp/", 0777);

?>

 

once again many thanks for the help !!  :D

 

Truegilly

Link to comment
Share on other sites

thank you very much !!

 

just had a go at changing the folder permissions with fireFTP that we use here but it doesnt have a right click option for changing permissions, so im gonna search the web for an alternative,

 

do you know any good ones your can reccomend ??

 

as soon is ive got one ill give it a go and post the results

 

truegilly  :D

Link to comment
Share on other sites

Hi guys,

 

just downloaded core FTP, so far a nice piece of software.

 

anyways have viewed the permissions on the /home/httpd/vhosts/clearblueseas.com/httpdocs/clearblueseas_admin/inc/img/temp folder and this is what it says....

 

USER

Read Y

Write Y

Execute Y

 

 

GROUP

Read Y

Write X

Execute Y

 

WORLD

Read Y

Write X

Execute Y

 

 

value = 755

 

File Permissions: drwxr-xr-x

 

many thanks :D

 

Truegilly

 

Link to comment
Share on other sites

right ive changed the file permissions so its 777.

 

trouble is im still getting that error.

 

one thing i havent mentioned is that on the server there are .htaccess all over the place, ive looked in the one on the root but it doesnt seem to influence anything from the upload directory. The .htaccess file that is in the parent directory two up from temp contains nothing of any signifcance.

 

has anyone had the same problem ??

 

thanks

 

truegilly  :'(

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.