Jump to content

Changing file permissions..


Scooby08

Recommended Posts

Is there a way to change file permissions to a file that is not created by php, but rather one that I uploaded myself?

 

I'm getting this error:

Warning: file_put_contents(head.tmpl) [function.file-put-contents]: failed to open stream: Permission denied in /path/functions.php on line 211

 

Maybe something like so:

<?php
system("chmod -R 777   \"/head.tmpl\" ");
?>

 

I don't know? Not sure? Any ideas??

Link to comment
https://forums.phpfreaks.com/topic/183885-changing-file-permissions/
Share on other sites

If you are uploading the file using FTP or your hosting control panel, the owner of the file is the user that the FTP server or the control panel us running under. The user that the web server/Php is running under cannot alter the permissions (that would kind of defeat the purpose of having permissions.)

 

You need to change the permissions on the folder and/or file using the same method that you used to upload it.

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.