我正在尝试通过fastCGI在HHVM(3.0)和Apache(2.4)上部署Symfony2(2.4)应用程序,按照此处的说明进行操作 - https://github.com/facebook/hhvm/wiki/FastCGI
虽然我可以通过这种方式正确执行单个php文件,但它似乎不适用于Symfony2路由系统。路由已正确解析(例如localhost / myapp / web / app_dev.php / my / route / to / something),但页面本身不会加载。相反,页面只输出“未找到”,HHVM记录以下内容:
无所事事。要么传递.php文件来运行,要么使用-m server
这似乎表示它认为它没有通过正确的php文件。
应该注意的是,部署使用HHVM 2.x附带的内置Web服务器工作正常。但是,从HHVM 3.0开始,不再支持此服务器。
为了使这项工作能够改变哪些配置,我感到很遗憾。即使是能够正确解决问题的指针也是一个很好的答案。
答案 0 :(得分:5)
最后通过使用以下配置文件来管理(大多数!):
Eval {
Jit = true
JitWarmupRequests = 1
}
Log {
Level = Info
Header = true
UseLogFile = true
File = /var/log/hhvm_error.log
Access {
* {
File = /var/log/hhvm_access.log
}
}
}
Server {
IP = 127.0.0.1
Port = 9000
ThreadCount = 77
# Change to match your local root
SourceRoot = /opt/lampp/htdocs/
MaxPostSize = 65 # in MB
}
VirtualHost {
* {
Pattern = .*
RewriteRules {
* {
pattern = .?
# change to app.php for production use
to = app_dev.php
# append the original query string
qsa = true
}
}
}
}
Stats {
Web = true
Memory = true
SQL = true
}
Http {
DefaultTimeout = 5
SlowQueryThreshold = 5000
}
这是基于我在这里找到的HHVM 2. *的配置:http://labs.qandidate.com/blog/2013/10/21/running-symfony-standard-on-hhvm/
此外,如果您使用的是Doctrine,则由于之前的错误,您必须修改您的依赖项才能使其与HHVM一起正常运行:Symfony2 and HHVM Declaration of Doctrine\DBAL\Driver\PDOConnection::prepare() must be compatible