Do not use
ini_set('memory_limit', '-1');
on a production server.
It means that PHP can "eat" all available memory on a server. It can be handy for testing/debugging apps but it should NOT be used on production servers.
Editing php.ini file should be sufficient. Also do not forget to restart PHP.