I am a relative noob to Apache and PHP. I have a small executable that I wrote myself that I wish to execute from PHP using the system() function. For lack of any better ideas, I put it in /var/www/html with my PHP script. When I attempt execute it, I (not surprisingly) get a complaint from SELinux ('SELinux is preventing the phptest from using potentially mislabeled files anon_inode (anon_inodefs_t). '). It tells me what I can do to allow access. ... but I am wondering: is there a 'stock' way to grant execute access to files? Is there a particular place they should live? I wrote the executable and I trust it. Eric
If safe_mode (PHP) is On, you must place your applications to the folder set in safe_mode_exec_dir directive.
Duh, I don't even know how to check. phpinfo() is not telling me it is on, and this code does not work: if(safe_mode(PHP)) print "Safe mode is ON"; else print "Safe mode is OFF"; But the PHP man page is telling me that using safe_mode() is lame and deprecated.
That is a SELinux issue. The explanation they give is the correct way to enable files to be executed by a webserver. That is why it is called SELinux. It is designed to give you fine granular control over what can and cannot happen on your box. I know it is a PITA, but there is not really much you can do about it. SELinux needs a four year degree all in itself. Too complicated for us feeble minded folks. But if the NSA uses it, they use it for a reason.