我需要在命令行上增加PHP的内存限制,以便我可以使用Composer.
输出 php -i | grep memory_limit
memory_limit => 256M => 256M
输出 php --ini
Configuration File (php.ini) Path: /usr/local/php5/lib Loaded Configuration File: /usr/local/php5/lib/php.ini Scan for additional .ini files in: /usr/local/php5/php.d Additional .ini files parsed: /usr/local/php5/php.d/10-extension_dir.ini, /usr/local/php5/php.d/20-extension-opcache.ini, /usr/local/php5/php.d/40-openssl.ini, /usr/local/php5/php.d/50-extension-apcu.ini, /usr/local/php5/php.d/50-extension-curl.ini, /usr/local/php5/php.d/50-extension-gmp.ini, /usr/local/php5/php.d/50-extension-igbinary.ini, /usr/local/php5/php.d/50-extension-imap.ini, /usr/local/php5/php.d/50-extension-intl.ini, /usr/local/php5/php.d/50-extension-mcrypt.ini, /usr/local/php5/php.d/50-extension-memcache.ini, /usr/local/php5/php.d/50-extension-memcached.ini, /usr/local/php5/php.d/50-extension-mongo.ini, /usr/local/php5/php.d/50-extension-mssql.ini, /usr/local/php5/php.d/50-extension-oauth.ini, /usr/local/php5/php.d/50-extension-pdo_dblib.ini, /usr/local/php5/php.d/50-extension-pdo_pgsql.ini, /usr/local/php5/php.d/50-extension-pgsql.ini, /usr/local/php5/php.d/50-extension-propro.ini, /usr/local/php5/php.d/50-extension-raphf.ini, /usr/local/php5/php.d/50-extension-readline.ini, /usr/local/php5/php.d/50-extension-redis.ini, /usr/local/php5/php.d/50-extension-solr.ini, /usr/local/php5/php.d/50-extension-ssh2.ini, /usr/local/php5/php.d/50-extension-twig.ini, /usr/local/php5/php.d/50-extension-uploadprogress.ini, /usr/local/php5/php.d/50-extension-xdebug.ini, /usr/local/php5/php.d/50-extension-xhprof.ini, /usr/local/php5/php.d/50-extension-xsl.ini, /usr/local/php5/php.d/60-extension-pecl_http.ini, /usr/local/php5/php.d/99-liip-developer.ini
所以我编辑/usr/local/php5/lib/php.ini
但它总是256MB ......
重启Apache,但它是cli,但仍然没有成功.
其中一个包含的文件有一个memory_limit
指令.使用此命令查找哪一个:
grep memory_limit /usr/local/php5/php.d/*
解析"附加的.ini文件"将在稍后解析,并将覆盖主要的设置php.ini
.
也许您应该找出php.ini在哪里
有时这不会做:
php -i | grep php.ini # turns out I just can't edit /etc/php.ini even when I'm root
那么您可以尝试以下操作:
locate php.ini # turns out it's here: /private/etc/php.ini
最后,使用sudo编辑/private/etc/php.ini
sudo vim /private/etc/php.ini
用保存文件
:wq!
任务完成。