Jump to content

function: lchown


Devine

Recommended Posts

open_basedir, I believe is set in your php.ini file.  Are you working on your own server?  As I understand it, it sets paths that php is allowed to operate on files.  If the file you're trying to work with is outside that file system path then you get this error. So your error message is telling you what these allowed paths are and that your file you're trying to work with is not in one of those paths.  so if it's your own server, change the paths in php.ini. 

Link to comment
https://forums.phpfreaks.com/topic/62337-function-lchown/#findComment-310236
Share on other sites

Ok, that's better.  First, are you really trying to lchown a symbolic link?  There's usually very little reason to do that.  Normally you would use chown() on a standard file.

 

Secondly, do you have permission to chown files?  Usually that will require root (superuser) access.  This also comes back to the question of why you are using lchown(), because it is a very unusual function to use.  If you explain what you are trying to do, then perhaps we can suggest an alternative.

Link to comment
https://forums.phpfreaks.com/topic/62337-function-lchown/#findComment-310677
Share on other sites

if it's your server, you would be able to chown under your OS, and would have no need to do it through php.

 

if your trying to gain access to other peoples files, we arent going to help you.

 

it's not my server, but it is my shared hosting account.. I'm trying to chown a file thats a folder down.. not up..

 

So the index file is: site.com/index.php

And the folder I'm trying to chown with the index.php file is: site.com/support4/

Link to comment
https://forums.phpfreaks.com/topic/62337-function-lchown/#findComment-311218
Share on other sites

If it's a shared hosting account and you do not have root access, then you cannot chown or lchown.  It doesn't matter where the file is or who it belongs to.  It just can't be done.

 

If you explain why you need to chown, then perhaps we can suggest an alternative.  Probably you need chmod instead.  chmod can be used to give other users permission to use files that belong to you.

Link to comment
https://forums.phpfreaks.com/topic/62337-function-lchown/#findComment-311487
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.