≡ Menu

Shell Script To Turn On or Off PHP Uploads For Php5-fpm/Apache/Nginx/Lighttpd Web Servers

A simple shell script wrapper to disable or enable PHP 5 upload support in an Apache or Nginx or Lighttpd web server. The script look for file_uploads directive in php.ini file and change its state from ON to OFF or vice-versa.

When you allow files to be uploaded to your system you assume a number of risks, files may not be what the appear (executables masquerading as images, php scripts uploaded and moved to a location where they may be run, et-cetera). If your site doesn’t actually require file uploads, disabling this will prevent files from being accepted inadvertently. We recommend that you always keep this to off. See our php security guide for sysadmin more information.

{ 1 comment… add one }
  • Jouni "rautamiekka" Järvinen November 14, 2016, 10:49 am

    I could be wrong, but doesn’t Bash support case-insensitive letter matching without having to use something like §[uU]§, in the main logic ?

Security: Are you a robot or human?

Leave a Comment