1

I need to modify in the htaccess the memory_limit, max_input_vars and max_execution_time of php. In order not to modify the global configuration of php on the server.

In my virtualhost, I have this configuration:

<FilesMatch \.php> 
    SetHandler "proxy:unix:/var/run/php/php7.3-fpm.sock|fcgi://localhost/" 
</FilesMatch> 

In my htaccess I have tested these two configs without success:

<IfModule php7_module>
    php_value memory_limit 512M
    php_value max_input_vars 10000
    php_value max_execution_time 1800
</IfModule>

And

<IfModule mod_php7.c>
    php_value memory_limit 512M
    php_value max_input_vars 10000
    php_value max_execution_time 1800
</IfModule>

In the case of php7.3-fpm.sock, do I have to use it another way?

Thanks

Jatniel
  • 1,967
  • 2
  • 19
  • 27

1 Answers1

1

in your configuration file, default path "/etc/php/7.3/fpm/pool.d/php7.3-fpm.conf" or your path, change to:

php_admin_value[memory_limit] = 512M
php_admin_value[max_input_vars] = 10000
php_admin_value[max_execution_time] = 1800

then restart your web service, and test your settings.

  • Hi @kleber-holtz, Thank you for your response. The thing is that I don't have to touch any system file, only htaccess. If it were global, I would have done it already. Thank you in any case – Jatniel Aug 11 '21 at 14:55
  • 1
    Okay, your syntax via htaccess is correct, the problem is with the interpreter. – Kleber Holtz Aug 11 '21 at 15:03