I have one setup running on a Raspberry Pi which uses php 8.2 and I was able to edit /etc/php/8.2/apache2/conf.d/00-sympl-web.ini to change the max_upload_filesize
A different setup on a different Pi is using Sury php-fpm 8.4 and I can’t work out how to change the config.
Changing /etc/php/8.4/fpm/php.ini didn’t seem to do anything.
phpinfo tells me the following. Is one of the other files the one to meddle with? If so, which?:
| Loaded Configuration File |
/etc/php/8.4/fpm/php.ini |
| Scan this dir for additional .ini files |
/etc/php/8.4/fpm/conf.d |
| Additional .ini files parsed |
/etc/php/8.4/fpm/conf.d/10-mysqlnd.ini, /etc/php/8.4/fpm/conf.d/10-opcache.ini, /etc/php/8.4/fpm/conf.d/10-pdo.ini, /etc/php/8.4/fpm/conf.d/15-xml.ini, /etc/php/8.4/fpm/conf.d/20-apcu.ini, /etc/php/8.4/fpm/conf.d/20-bz2.ini, /etc/php/8.4/fpm/conf.d/20-calendar.ini, /etc/php/8.4/fpm/conf.d/20-ctype.ini, /etc/php/8.4/fpm/conf.d/20-curl.ini, /etc/php/8.4/fpm/conf.d/20-dom.ini, /etc/php/8.4/fpm/conf.d/20-enchant.ini, /etc/php/8.4/fpm/conf.d/20-exif.ini, /etc/php/8.4/fpm/conf.d/20-ffi.ini, /etc/php/8.4/fpm/conf.d/20-fileinfo.ini, /etc/php/8.4/fpm/conf.d/20-ftp.ini, /etc/php/8.4/fpm/conf.d/20-gd.ini, /etc/php/8.4/fpm/conf.d/20-gettext.ini, /etc/php/8.4/fpm/conf.d/20-iconv.ini, /etc/php/8.4/fpm/conf.d/20-imagick.ini, /etc/php/8.4/fpm/conf.d/20-intl.ini, /etc/php/8.4/fpm/conf.d/20-mbstring.ini, /etc/php/8.4/fpm/conf.d/20-mysqli.ini, /etc/php/8.4/fpm/conf.d/20-pdo_mysql.ini, /etc/php/8.4/fpm/conf.d/20-phar.ini, /etc/php/8.4/fpm/conf.d/20-posix.ini, /etc/php/8.4/fpm/conf.d/20-readline.ini, /etc/php/8.4/fpm/conf.d/20-shmop.ini, /etc/php/8.4/fpm/conf.d/20-simplexml.ini, /etc/php/8.4/fpm/conf.d/20-sockets.ini, /etc/php/8.4/fpm/conf.d/20-sysvmsg.ini, /etc/php/8.4/fpm/conf.d/20-sysvsem.ini, /etc/php/8.4/fpm/conf.d/20-sysvshm.ini, /etc/php/8.4/fpm/conf.d/20-tokenizer.ini, /etc/php/8.4/fpm/conf.d/20-xmlreader.ini, /etc/php/8.4/fpm/conf.d/20-xmlwriter.ini, /etc/php/8.4/fpm/conf.d/20-xsl.ini, /etc/php/8.4/fpm/conf.d/20-zip.ini |
Generally, if you’re making changes, they should be done on the site itself, either via a .htaccess file, or a .user.ini file.
PHP settings heavily depends on which version of Sympl you’re using, and therefore if you’re using mod-php (Apache) or php-fpm (config/php).
By the sound of it, you’re running php 8.4 under FPM, so you’ll want to edit the relevant FPM pool, which would likely be something like /etc/php/8.4/fpm/pool.d/www.conf.
If you’re running Sympl 12+, then Sympl has support for per-pool includes, so you can make changes there.
https://wiki.sympl.io/view/Website_Configuration_Reference#Extended_Configuration
You can do it on a per-site basis too, with a file in /srv/example.com/config/apache.d
By the way, it’s upload_max_filesize, not max_upload_filesize 
And you may need to adjust post_max_size too…
On tis system, in /etc/php/fpm/pool.d the files are
sympl-web-php.conf and www.conf_disabled
There is presumably a reason for this, but I have no idea what it is.
I think the idea of a per site setting seems like a good plan.
Overall, I am left wondering where this is all documented?
That forum link seems to be using your SSO so it won’t work for me
I’m a bit baffled by all this.
I created the file php.ini in the apache.d folder. and reloaded Apache.
Made no difference.
I renamed that file to php.conf and reloaded Apache. Apache refused to start. So I removed it.
I want to increase the file size from 128MB
What should the filename be, and what should be in the file?
Something like…
upload_max_filesize = 2048M
post_max_size = 2048M
Having the lines
php_value upload_max_filesize 512M
php_value post_max_size 512M
in .htaccess did nothing
What should the filename be, and what should be in the file?
Something like…
upload_max_filesize = 2048M
post_max_size = 2048M
Having the lines
php_value upload_max_filesize 512M
php_value post_max_size 512M
I think the file name in apache.d can be anything, but I make mine end .conf .
The contents are apache config commands, but in this case they specify a value to be passed to the PHP interpreter, so your second pair of lines have the correct syntax.
Incidentally, before restarting apache after a change like this, it’s always a good idea to test it. I use:
sudo apachectl -t
It will at least tell you which lines are wrong, and it prevents you from halting the web server if an error exists.
I’m not sure why it didn’t work in .htaccess, but I think with FPM you have to put PHP config in .user.ini, also there you don’t need to say php_value e.g. I have a .user.ini that reads:
memory_limit = 400M
post_max_size = 350M
upload_max_filesize = 300M
(which reminds me: you may need to adjust your memory limit too)
Fixed the link, and ill look into why it was unhappy.
In short, theres a few different ways of invoking PHP though Apache, and Sympl can use two methods.
mod_php
This is where every Apache process uses it’s own instance of PHP running under www-data, and the configuration is read from the Apache configuration and /etc/php/<version>/apache.
If you haven’t selected a PHP version, or you’re using Sympl before version 12, you’ll use the default mod_php, which will be the default PHP version for the distribution.
As this is being run through Apache, you can use .htaccess to adjust the PHP processes.
PHP-FPM
This is where there’s a separate PHP set of processes, with one or more ‘pools’ of resources and separate configurations, in /etc/php/<version>/fpm/pool.d.
If you have selected a PHP version via config/php, then Sympl will install the relevant version of PHP for you, along with the relevant PHP modules/extensions as specified, and swap the site to use the FPM process instead.
It will also convert any .htaccess rules into .user.ini rules, but you can also make pool-wide changes by adding things to /etc/sympl/php/*<version>*/includes.d/*<pool_name>*.conf.
Hope that makes more sense!
That is now beginning to be clear. I think that simple explanation makes it far easier to understand what is going on.
Am I right in thinking that .user.ini is only updated in the htdocs directory and not in subdirectories?