Quercus是Java环境中PHP的可行替代品吗? [英] Is Quercus a viable replacement for PHP in Java environments?

查看:142
本文介绍了Quercus是Java环境中PHP的可行替代品吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于那些不知道 Quercus 是什么的人来说,这个问题磕磕绊绊的是 - 它是用Java完成的PHP实现。

For anyone stumbling upon this question who doesn't know what Quercus is - it is an implementation of PHP done in Java.

对于我目前正在处理的项目,我们通过cgi通过servlet提供php页面(我知道它很笨重,但是这是支持遗留代码的要求)。我很高兴发现了Quercus项目,因为它似乎是将我们的项目转移到更纯粹的Java环境的有希望的途径。

For a project that I am currently working on we serve php pages via cgi over servlets (I know it is clunky, but it is a requirement to support legacy code). I was excited to discover the Quercus project because it looked like a promising path to move our project to a more pure Java environment.

我有几个关于Quercus的问题:

I have a few questions regarding Quercus:


  • 您是否在运输产品中使用了Quercus?

  • 支持多少PHP API?

  • 您使用它有什么问题?

  • 您是否能够使用Jetty?你有没有听说过与Jetty合作? (我无法弄明白)

  • Have you used Quercus in a shipping product?
  • How much of the php API is supported?
  • What are any gotchas you have had working with it?
  • Have you been able to make it work with Jetty? Have you ever heard of it working with Jetty? (I couldn't figure it out)

推荐答案

我用WordPress进行了测试性能几乎是普通Apache / PHP下默认WordPress安装的两倍。哪个还不是那么好。

I've tested it with WordPress and performance was almost double what a default WordPress install was under regular Apache/PHP. Which still isn't that great.

我们注意到虽然Quercus支持PHP中的curl命令,但它不支持所有curl选项。所以自动插件下载不起作用。这不是什么大不了的事,你可以随时下载插件并手动安装它们。但这是一个红旗,因为我们不知道还有什么可行。这也意味着Facebook的PHP库无法正常工作(最有可能)。

We did notice that while Quercus supports the curl commands in PHP, it doesn't support all the curl options. So automatic plugin downloads did not work. It wasn't that big of a deal, you can always download the plug-ins and install them manually. But this was a red flag since we didn't know what else would work. It also meant Facebook's PHP library wouldn't work right (most likely).

如果您进行了大量的数据库连接和调用,那么您应该会看到该领域的性能大幅提升,因为将使用数据库连接池。

If you do a lot of database connections and calls, you should see a big performance boost in that area since database connection pooling will be used.

如果您正在编写代码,我会说这是一个非常可行的选择。支持足够的PHP,如果你发现一些不起作用的东西,你可以使用支持的不同PHP命令,或者只使用Java命令。

If you are writing the code, I would say it's a very viable option. Enough of PHP is supported that if you find something that doesn't work, you can use a different PHP command that is supported, or just use a Java command.

这篇关于Quercus是Java环境中PHP的可行替代品吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆