什么是PHP脚本的最大文件大小[关闭]

What is the maximum filesize of a php script to be executed by php. Not uploading but executing (running) the script?

I don't think there is a maximum file size as it wouldn't make any sense. However, if the file grows to huge levels and there is a lot of processing going on, you could end up with memory exhausted errors and/or server timeouts. This depends on your server setup, your server specs and your PHP configuration.

Depends on the memory limit defined in php.ini for heavy memory operations and the execution time also defined, it depends how optimised your code is, it cam be small with an infinite recursion and you will get a timeout

Since the php script needs to be loaded into memory, I would say its however much memory you have on your computer. I've never found a limit myself or at least not one that I have hit and I have worked on some very large PHP projects.

Also remember, you can have a single file or hundreds of files all "included". To PHP it's the same thing.

When looking at files in APC there doesn't appear any indication in the APC configuration that there is a maximum PHP size either, nor is there in the PHP.ini file.

So I would be willing to say, if it fits into your computers memory then PHP can execute it - even if it does take PHP a little while to create the op codes etc!