Hi! I have some problems. I'm kind of n00b, so hope you can help! I have a Fedora server with Apache and PHP. But I get a permission denied when I'm running a script from the webbrowser. Here is my PHP code: Code: function execute($command) { $command .= ' 2>&1'; $handle = popen($command, 'r'); $log = ''; while (!feof($handle)) { $line = fread($handle, 1024); $log .= $line; } pclose($handle); return $log; } echo execute("wakeonlan 00:04:61:6B:A4:71"); Output: socket : Permission denied at /usr/bin/wakeonlan line 78. What permissions do I have to set? Thanks
[root@localhost ~]# ls -l /usr/bin/wakeonlan -r-xr-xr-x 1 root root 5318 okt 27 01:41 /usr/bin/wakeonlan
Greetings, I am having a similar problem. I've created a script that reads a template file then creates and posts the template into a new file using fopen but it returns with "fopen(/usr/web/bsu/test.php): failed to open stream: Permission denied in /usr/web/bsu/admin/includes/functions/content.php on line 134" I've double checked the /usr/web/bsu directory and it's permissions are set to 777. Are there any other permissions that need to be set for this kind of action?
Hope this is of some use, if you want to change permissions for the entire folder and its contents, you would do this Code: chmod 777 /directory name -R otherwise just do Code: chmod 777 /directory/file.php Your permissions may differ, 777 was only for an example
The folder and files are already 777 and PHP safe mode is disabled. I've even gone so far as to try chown on the directory to apache to see if the PHP group needed permission but still didn't work
Finally got it. For those with a similar problem. Check SELinux enforcing parameters. /etc/selinux/config Line 6: SELINUX=enforcing Change Line 6: SELINUX=disabled