I have PHP Version 7.2.9 on a Mac running OSX 10.13.6. If I load phpinfo(), I see in safari the memory_limit = 256M. However when I look in php.ini (/usr/local/php5/lib/php.ini) the memory_limit = 128M. What is the cause of this discrepancy - obviously the limit is set somewhere else, but where? I need to increase the memory limit
0
votes
Can you check how many PHP version has been setup in your server? May be you configure more than one like PHP5, PHP7 and you are checking in unset php version .ini file
- Ayaz Ali Shah
Both php5 & php 7 are present. Both are associated with a php.ini file. The ini files are identical - if you change one the change is reflected in the other. I have also copied the php.ini file to /etc and done a restart. But this still does not cause the memory limit to change.
- Alan Young
2 Answers
0
votes
0
votes
PHP runs in two environments.
1. CLI
You have the command line instance, which in your case is running version 5
/etc/php/X/cli/php.ini
2. Webserver
You have the instance tied to your webserver. You can find in:
/etc/php/X/apache2/php.ini
Changing the setting on any of them only affect that instance. The X
stands for the version, so if you go to /etc/php/
you should see what's available to you.
Note: in your case, /etc/php/
should be switched to /usr/local/php/