php.ini does not get loaded

Kernels & Hardware, configuring network, installing services

php.ini does not get loaded

Postby hstoellinger » 2020-09-08 14:13

Hello,
I run a Debian 10.1 server with Drupal 8.9.3, Apache2 and PHP 7.3.
Now I want to increase the maximum upload file size , e.g., so as to be able to upload large images/videos, using the appropriate specifications in php.ini.
Displaying the various definitions using phpinfo.php, I see that all kinds of php.ini files are loaded at startup, but /etc/php/7.3/apache2/php.ini does NOT get loaded. I have "circumvented" the issue by specifying the necessary in .htaccess. However, I feel that php.ini would be the appropriate place for this. Can anybody give me an idea why my "normal" php.ini file does NOT get loaded. :x
Thanks in advance.
Regards
H. Stoellinger
hstoellinger
 
Posts: 42
Joined: 2010-11-20 18:31

Re: php.ini does not get loaded

Postby reinob » 2020-09-08 16:32

How did you install php?

With standard debian 10 (BTW current version is 10.5, you should update), you have, at /etc/php/7.3 the following directories: { cgi, cli, fpm }, as well as mods-available and phpdbg.

Depending on how you are using php (which you didn't mention) you will need to edit the php.ini under the corresponding directory. Note: /etc/php/7.3/apache2/php.ini does not (and should not) exist.

For example, I use fpm, so I edit /etc/php/7.3/fpm/php.ini, or, even better, I place my local modifications in /etc/php/7.3/fpm/conf.d, so that they will not be overwritten if php is updated.
reinob
 
Posts: 819
Joined: 2014-06-30 11:42

Re: php.ini does not get loaded

Postby hstoellinger » 2020-09-09 09:40

Thanks for the quick reply!
cat /etc/debian_version shows that I actually am already at Debian 10.5, doing a sudo apt update && sudo apt upgrade nearly every day. 10.1 was the originally installed version. I must admit that I didn't take a note on how I actually installed php. In any case, FPM is not installed - the website I look after is not at all very busy! Would it nevertheless make sense to install FPM in any case?
I removed the "php_value upload_max_filesize 32M" specification from .htaccess and put it into /etc/php/7.3/apache2/conf.d. After restarting the apache2 service phpinfo.php now shows 32MB. So I am a (kind of) happy guy now.
Thanks for your clarifications
Regards
H. Stoellinger
hstoellinger
 
Posts: 42
Joined: 2010-11-20 18:31


Return to System configuration

Who is online

Users browsing this forum: No registered users and 13 guests

fashionable