I have an apache webserver running as user apache, and the application I'm hosting (Wordpress) requires certain folders with write permissions by the user apache, I want to limit the write permissions (creation of files) to only .png, .gif, .jpg and .pdf files, but deny .php file creation. Is it possible to do this from apache or linux?
Thank you for your help.
[EDIT]
As per Michael Kjörling suggestion, I added the following to a .htaccess file inside every upload directory:
<FilesMatch "\.php$">
Order Allow,Deny
Deny from all
</FilesMatch>