0

我写了一个应用程序。但是存在内存溢出的问题。有没有办法清除 PHP 4 中的所有垃圾值?

4

2 回答 2

1

I think more information about your specific case and environment (I am just guessing that you are running PHP from a web server and not CLI) is needed. And you should look through your entire code yourself for places that can be optimized.

As you probably know, garbage collection is not a part of PHP 4. Check out unset and http://www.obdev.at/developers/articles/00002.html for some pointers.

于 2012-09-11T16:46:53.033 回答
0

如果问题是内存溢出。您可以使用:

ini_set('memory_limit', '128M'); //or the quantity of memory you need

这将扩展该脚本在 httpd.conf 上使用的默认内存。

注意:我不确定它是否适用于 php 4,但是,试一试。

于 2012-09-11T17:03:45.510 回答