If your web server is apache ,you can add follow line:
<Directory /website/attachments> php_flag engine off </Directory>
We want disable upload directory php execute privileges on nginx,It’s so simple
location /upload/ { location ~ .*\.(php)?$ { deny all; }
limit more directory
location ~* ^/(upload|images)/.*\.(php|php5)$
If your web server is lighthttpd you can
$HTTP["url"] =~ “^/(forumdata|templates|customavatars?)/” { fastcgi.server = () Apache: <Location “/forumdata”> php_admin_flag engine off Options -ExecCGI AddType text/plain .html .htm .shtml .php </Location>
Hope it will help you.