I know that to use exec() the user on the webserver must have execution rights through PHP. However, I was wondering if there's a way to first TEST if a user has this permission. Does anyone know?
...would eval(exec('')) work?
Ruben K.
May 9 2005, 07:01 AM
just try to do a command. if it fails, you do not have permissions
I honestly don't know. Of course I could do that, but I don't really have any test server where I don't have permissions, so was wondering if someone else knew already by chance. I guess I'll just have to mess around otherwise.
BTW, I'd need to know for cron-jobs. If I don't have exec() permissions on the server, then I'll have to do a workaround on-load of a page rather than using tasksched or cron...depending on the server used.
tomek__w
May 9 2005, 05:52 PM
Not being that good with PHP but........
The function fileperms() returns the permission on a file as an octal number.
read = 4, write = 2, and execute = 1 Just add required permission values to achieve what you want/need
7 would mean you have read, write and execute 5 would mean read and execute 4 would mean you only have read etc
Hope this help.......... and that I am right!
TTFN
Brendon Koz
May 9 2005, 06:44 PM
Well, I don't work with flatfiles too often, nor do I use Linux on a daily basis, but I do believe you are correct. However, the exec() function allows one to issue commands to the OS as if it was in a shell prompt, it has nothing to do with file access and permissions.
But, thanks for your help none the less!
tomek__w
May 10 2005, 12:17 PM
QUOTE(malikyte @ May 9 2005, 07:44 PM)
Well, I don't work with flatfiles too often, nor do I use Linux on a daily basis, but I do believe you are correct. However, the exec() function allows one to issue commands to the OS as if it was in a shell prompt, it has nothing to do with file access and permissions.
But, thanks for your help none the less!
Sorry I could not help!
Having said that at least I have learned something from this.
TTFN
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.