When i execute some script with php language for a big data, like Export data, Extraction and Print data, an error has been occurred:
Fatal error: Out of memory (allocated 493617152) (tried to allocate 345571051 bytes)
Although I have increased the memory in the script by the instruction below:
ini_set('memory_limit', '3072M');
And for more assurance, I have even modified the value of memory_limit in php.ini file to 3072M:
memory_limit=3072M
The size of RAM on the server used is 4GB.
What's the problem there?
ini_set('memory_limit', '3072M');
is simply ignored: No scritp can increase its own memory limit - would be a nice attack vector for any shared webhost!
Edit
If you run it from the command line, try php -d memory_limit=3072M /path/to/file
If you run it from a webserver edit php.ini, -htaccess or whatever is needed for your installation