2

I tried Googling and browsing through PHP docs but I can't find a limit on the maximum size of a script that PHP can execute. If there is any, what is it?

2
  • 1
    why do you need to know this? Commented Nov 15, 2011 at 1:41
  • Memory and execution time...?! Commented Nov 15, 2011 at 1:43

2 Answers 2

3

I would imagine it would be what the limit on your memory is minus a heck of a lot of overhead.

Sign up to request clarification or add additional context in comments.

4 Comments

Don't forget the execution time limit
You mean the limit is my machine's memory?
it would be a big limiting factor. plus, it would take lot of ram to analyze it and create the objects.
@Dave, That would be one of many limiting factors. I suspect it also has to do with the platform... 32-bit vs 64-bit, and the max number of lines or something like that. In any case, I've seen some monstrosities, and none of them ever hit a PHP parser limit. They will hit PHP's checks for memory limit and execution time limit first.
2

Size of the script is irrelevant. You need to have enough memory to run it. This means your web server (apache, nginx, etc) needs to be able to run without hitting the dreaded OOM.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.