You can create your own user.ini file inside whatever sub-directory your script is in. There's a lot of documentation on how to use the various configuration features inside php.ini online at
http://php.net/configuration.
memory_limit = 32M;
and then make or amend a .htaccess file as well
RLimitMEM 256000000
This will increase the memory limit for a php script to 32MB
Alternatively, you can use the PHP Configuration option within your hosting control panel in order to configure these settings:
If this still does not work, take note of the error message that is produced. Is PHP now reporting that it is running out of memory at 32MB, or is it still reporting the old amount?
In the former case, try upping the memory again. If you keep getting memory errors at each level, it is quite likely that an infinite loop has been created within your script, and it will run out of memory, no matter how much you use. In the latter case, it is likely that the PHP memory limit is being set elsewhere, either within your code or via another user.ini.