Laravel报告内存大小268MB耗尽但php.ini说512MB

时间:2018-02-01 04:42:51

标签: php laravel laravel-5

Laravel作业监听器运行了数以万计的记录,并提供了错误

PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 1179648 bytes) in .../vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php on line 184


[Symfony\Component\Debug\Exception\FatalErrorException]                             
 Allowed memory size of 268435456 bytes exhausted (tried to allocate 1179648 bytes)  

我已经证明phpinfo()使用了memory_limit = 512M,所以当512>时我不知道发生了什么。 268 :) - 还有belongsTo关系与它有什么关系?

1 个答案:

答案 0 :(得分:2)

你提到Laravel作业监听器,它让我假设你通过命令行运行它。命令行执行的Toolbar toolbar; toolbar = (Toolbar) findViewById(R.id.toolbar); toolbar.setPadding(0, 0, 0, 0);//for tab otherwise give space in tab toolbar.setContentInsetsAbsolute(0, 0); setSupportActionBar(toolbar); 可能与Web服务器加载的不同。请确保php.ini的{​​{1}}值相同。要从shell(假设Linux)查找命令行memory_limit的位置,请运行

php.ini