1

I have /etc/opt/remi/php80/php.ini

memory_limit = 2048M

when i do: php -r "echo ini_get('memory_limit').PHP_EOL;"

I get: 2048M

phpinfo() shows

Loaded Configuration File   /etc/opt/remi/php80/php.ini
memory_limit    128M    128M

what am i missing?

notes:

memory_limit does not exist in any other ini file in any folder/subfolder of this dir.

I have restarted apache numerous times.

5
  • 1
    Actually php in cli and in web are different. Commented Jul 21, 2022 at 18:36
  • 1
    Does this answer your question? What is difference between PHP cli and PHP cgi? Commented Jul 21, 2022 at 18:39
  • 1
    not even remotely. how do i get apache to respect the 2048M memory_limit? Commented Jul 21, 2022 at 18:44
  • Does this help? askubuntu.com/a/1302286 Commented Jul 21, 2022 at 20:15
  • 1
    Which distro ? Modern ones use php-fpm , so you have to restart the service (php80-php-fpm), not apache. Commented Jul 22, 2022 at 5:02

1 Answer 1

1

Memory limit is decoded into a signed 32 bit integer number of bytes so you may be overflowing. Why not set it to -1 which is unlimited. Also if you're running php-fcgi then you need to restart that service rather than Apache.

Sign up to request clarification or add additional context in comments.

1 Comment

memory_limit of -1 is strongly discouraged on production environments since that allows PHP to eat all your resources and crash the server

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.