Hi, I've just been struggling with something that sounds very similar to this issue and have (for the meantime...fingers crossed...a solution!)
I tried a number of setting in my php.ini (and php5.ini) RE memory and whilst phpinfo would tell me it has picked up these settings I continued to have issues when it came to accessing certain parts of the site - mainly settings.php assocaited pages but a number of others too. When I turned debug on (done via the db table mdl_settings as I could not get access to the correct Moodle page to do this via the front end!) then it reported the fatal "out of memory" error message but on reloading the same page the file and line it referred to changed almost every time - thus it led me to thinking that the problem was not where it was being reported - shocker!!
I also saw in my server (on a hosted package BTW...which may be an important point to note!) error logs a message RE "zend_mm_heap corrupted" which again led me on a whild goose chase (I think!). Anyhow, after spending many hours trying various settings in php.in (and php5.ini just in case since I am using php 5 as default and they have php 4 installe don my hosting) as well as entries in my .htaccess file I came across the the following suggestion (from my hosting provider) to set in .htaccess "RLimitMem 128000000" (I have actualy set it to 256000000 to match the 256M limit in php.ini but will experiment on how low I can go later).
I have the following on my .htaccess file (just in case it is also useful)
SetEnv DEFAULT_PHP_VERSION 5
php_value memory_limit 256M
php_value realpath_cache_size = 128K
php_value realpath_cache_ttl = 150
RLimitMem 256000000
and the following in my php.ini (AND php5.ini)
max_execution_time = 60
upload_max_filesize = 12M
post_max_size = 12M
memory_limit = 256M
display_errors = 0
register_globals = 0
realpath_cache_size = 128K
realpath_cache_ttl = 150
display_errors = on
log_errors = on
display_startup_errors = on
error_reporting = E_ALL
output_buffering= 8192
(note: .htaccess and php.ini and php5.ini are in the root of my Moodle 2 instalation NOT the root of my hosting as some suggest)
Some of this may be overkill and some is for debugging purposes but I will experiment on what I can drop later...I'm just glad I have managed to get it to work. FYI I also had issues on install with the part that creates the tables in that I did not get the continue button appearing but an F5 on this page seemed to complete this process with the appearance of the continue button and it seems to have completed. I had this issue with Moodle 1.9 also and have a number of successful and live instances running even after this so not sure what went on other than perhaps a timeout due to slowness (remember...I'm using a shared hosting service)
Hopefully some of this is useful to those out there trying the same thing and it works for you. 100's if not 1000's of times read posts that folks have had similar/same problems to mine and they have posted - "I've got it working now" with no explanation so...here's mine and I hope it works for you.