I have multiple sites running on Apache2 and PHP on Ubuntu Server. I know PHP has a php.ini file that lets you set values for upload_max_filesize, max_file_uploads , upload_tmp_dir etc. But that applies one value to all sites.
How can set directives for each site? For Eg: I'd like to set upload_max_filesize to 50M for sitea.com and upload_max_filesize to 5M for siteb.com.
Similarly, I'd like to set unique a session.name for each sites. How can this be done? I read there's something called PHP_INI_USER, PHP_INI_PERDIR, PHP_INI_SYSTEM, PHP_INI_ALL, so how can I do this?
You can use
.htaccessfiles per site (or even per-folder) to set PHP configuration values - at least for most settings: if you look in the configuration directives documentation, for every setting that is marked as eitherPHP_INI_PERDIRorPHP_INI_ALLyou can set these in a.htaccessfile using thephp_valueorphp_flagcommands as documented in PHP's "How to change configuration settings" document.For example to set
upload_max_filesizein a website, create a.htaccessfile at the document root of that website and put in it the text:Unfortunately,
max_file_uploadsandupload_tmp_dirare settings marked asPHP_INI_SYSTEMand you cannot change them in a.htaccessfile...