Jump to content

chmod 777 error


barrowvian

Recommended Posts

im currently making an upload images function to write a file that i have create upon submission from the previous page, this is the code i use;

mkdir($thisdir ."/tempprofileimages" . "/temp.$firstname$surname", 0777);
	chmod($thisdir ."/tempprofileimages" . "/temp.$firstname$surname", 0777);

 

However, when i try to upload the image to the newly created folder i still get the 'cannot write to file, please chmod 777 it'. How do i overcome this issue?

 

Link to comment
https://forums.phpfreaks.com/topic/196780-chmod-777-error/
Share on other sites

I expect it may be that the user executing scripts on your system (usually "nobody:nobody") doesn't have CHMOD permission.

Also, I have to ask why are you using concatenation here:

"/tempprofileimages" . "/temp.$firstname$surname"

? It's the same things as doing

"/tempprofileimages/temp.$firstname$surname"

.

Also, you don't need to specify the mode (permissions) since the default value of mkdir() is 0777. The only other thing I'd suggest is that you try doing it recursively (

mkdir($dir, , TRUE);

).

Link to comment
https://forums.phpfreaks.com/topic/196780-chmod-777-error/#findComment-1033070
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.