AjaXplorer [用 PHP 编写] 在 IIS 上太慢
我已经在我的 IIS (Windows Server 2008 SP2 x64) 上安装了用 PHP 编写的 AjaXplorer(非常好的 Web 文件浏览器)。它对我来说太慢了。
可能是什么原因? php.ini中有一些设置吗?或者,也许 IIS 有问题?
我使用 32 位 PHP,php-cgi.exe 作为解释器。
问候,
I've installed AjaXplorer (very nice web file explorer), written in PHP, on my IIS (Windows Server 2008 SP2 x64). It works too slow for me.
What can be the cause? Are there some settings in php.ini? Or, maybe, something is wrong with IIS?
I use 32-bit PHP, php-cgi.exe as interpreter.
Regards,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,CGI 总是很慢。它需要为每个请求启动整个 PHP 运行时。尝试使用 FastCGI (如果您使用的是 IIS 7,或如果您使用的是 IIS 6)...
之后,尝试看看为什么它很慢。是因为 PHP 脚本需要很长时间才能执行(意味着这是代码问题),还是因为服务器配置。要进行测试,请将其修改为 PHP 程序入口点 (index.php) 的开头:
将
Completed in n Seconds
写入生成的输出的末尾(即使die( )
被调用)。如果 Ajax 调用预计返回 JSON,则可能会导致一些问题,因此通常不要这样做,只是为了试图弄清楚发生了什么。因此,如果总请求花费了 1 秒,但您看到
Completed in 0.004 Seconds
,您就知道 PHP 代码本身不是问题(它要么在 CGI 解释器的设置中,要么在某个地方)其他在 IIS 中)...这至少应该告诉你问题出在哪里...
First off, CGI will always be slow. It needs to boot the entire PHP runtime for each request. Try using FastCGI (If you're using IIS 7, or if you're using IIS 6)...
After that, try to see why it's slow. Is it because the PHP script takes a long time to execute (meaning it's a code issue), or is it because of a server config. To test, modify this into the start of the entrance point of the PHP program (index.php):
That write
Completed in n Seconds
to the end of the generated output (even ifdie()
is called). It may cause some issues if Ajax calls are expected to return JSON, so don't do it as a rule, just for trying to figure out what's going on.So, if the total request takes 1 second, yet you see
Completed in 0.004 Seconds
, you know that the PHP code itself is not the issue (it's either in the setup of the interpreter by CGI, or somewhere else in IIS)...That should at least show you where the problem is...