Forum Moderators: coopster
If you want some simple caching that works, I recommend smarty.
[smarty.php.net...]
the thing is, for example, if i get digged, the server will go down because of the requests. i need to cache the already compiled code so that every new request uses the cache instead of recompiling the php again.
What should i use for that?
because i dont have access to my servers php.ini or whatsoever. i need a pure-php caching system.
i mean, is there a way to COMPLETELY cache the php page into some file, so the php engine wont have to recompile the file in "n" minutes.
PHP is interpreted, not compiled.
What exactly is your PHP page outputting? Does the output change with every access?
I don't think you are going to find anything to do what you want in PHP itself - the common opcode caches hook into the PHP engine itself to enable them to store (and optionally optimize) the PHP opcode files in on disk and/or in memory.
[edited by: FalseDawn at 9:15 pm (utc) on Oct. 31, 2006]
PHP is interpreted, not compiled.
if i get digged, the server will go down because of the requests
But it doesn't matter if it is parsed or interpreted or compiled. The slowness could be because of:
1. unoptimized database - check how slow are your queries: microtime after - microtime before.
2. Check for loops, file reading, recurency in your script.
3. Optimize your queries to limit them to 1-3 per page.
Regards
Michal
PHP scripts are "compiled" into "bytecodes" that the binary file php.exe then interprets and executes(with the help of the other php modules where needed, of course).
So I guess it is "compiled" (in a loose sense of the term), and then "interpreted" :)