0

I have various domains hosted on one server - however they all seem to load from the same PHP.ini. I want the different domains to be able to upload different filesizes, for instance, our public facing website should have a very low filesize as users do not need to upload anything, so that would make the website secure if they filesize was small.

But for our staff-based websites, I need them to be able to upload large files (up to 100mb). But I am reluctant to set the upload size so high as I feel it would compromise our public websites.

How can I set different upload sizes for the different domains?

Using Apache and Php 7.1

Chud37
  • 123
  • 1
  • 7

2 Answers2

2

Many php.ini settings can also be placed inside the <VirtualHost *:80>...</VirtualHost> block when using mod_php with apache with the php_admin_value and php_admin_flag directives. See http://php.net/manual/en/configuration.changes.php

<VirtualHost *:80>
  ServerName www.example.com
  php_admin_value upload_max_filesize 100M
  ...
</VirtualHost>
HBruijn
  • 77,029
  • 24
  • 135
  • 201
1

If your server running with cPanel, you can install PHP.INI Manager plugin, you will get awesome features:

  • List custom php.ini files, per user
  • Ability to activate / deactivate the use of a custom php.ini file per-user
  • Ability to update all custom php.ini files with the global copy
  • Compatible with EasyApache4 and MultiPHP

Installation instructions:

The PHP.INI tabs will available on your WHM -> Plugins.