php内存不足错误

During a symphony2 php product installation I receive

PHP Fatal error:  Out of memory (allocated 190578688) (tried to allocate 1048576 bytes)

In php.ini memory_limit is -1.

In my virtual server I have 2GB of RAM: may be I need more RAM?

Some php installations tend to have separate php.ini files for Apache and CLI (command line). You are installing Symfony2, I suspect that you are doing this using composer on cli.

Check what is your file structure for your php installation. If there are two ini's, one under /apache, and one under /cli, you know what to do :)

Also try setting memory_limit for big, but sane value. Having at least 8 gb of ram it's good idea to set it between 2 and 4 gigs. This is because sometimes you can fall into never-ending loop that eats your ram (for example try var_dump() on Doctrine resultset, or just have fun with recurrence), and render your system unresponsive if there isn't any memory limit for php. Hope this helps :)