This is helpful when you don't want to disable SELinux but do want to allow apache to execute an external program. For example wkhtmltopdf. Run the following commands from the terminal. (This has been tested in CentOS 7.)
setsebool httpd_execmem on
chcon -R -t httpd_sys_rw_content_t dir
setsebool httpd_execmem on
that was extremely helpful!! thanks