To disable file uploads in PHP for Apache, Nginx, or Lighttpd web servers, you need to modify the PHP configuration file php.ini.
Here’s how to disable file uploads in PHP:
- Open the php.inifile:
sudo nano /etc/php/7.4/fpm/php.ini
- Find the following line:
file_uploads = On
- Change OntoOff:
file_uploads = Off
- Save the changes and exit the editor.
- Restart the web server to apply the changes:
sudo systemctl restart nginx
Note: The location of the php.ini file and the command to restart the web server may vary depending on your specific web server and distribution.
After making these changes, PHP file uploads will be disabled on your server.
