Why PHP runs very slow over apache server
I am having a bit performance problem with my PHP pages. My application is combined of two different languages, PHP and JSP which are using apache and tomcat on top. My JSPs are very fast but php pages are like 10 times slower and their both using the same database too. I know JAVA supp开发者_开发知识库osed to be faster than PHP but my application is running extremely slow on PHP section BUT not on JSPs.
Also, I am 100% sure nothing is wrong with my PHP scripts but it looks like it is apache that takes long to process php and some static files. Please let me know if anyone has ever came across such problem. I don't mind posting my apache conf file if you need to have a look at it.
Note: Apache is configured to serve all the files apart from Servlets/JSPs and the JSPs are running faster even than some htmls.
Thanks in advance.
- For PHP use some kind of opcode cache like APC or eAccelerator otherwise PHP has to parse your files on each request.
- For general apache tuning you should do some googling, couple of things like disabling
.htaccess
files comes to mind but it still should be faster than JSP... Some apache performance tuning tips.
精彩评论