【发布时间】:2015-05-01 09:01:53
【问题描述】:
我可以使用用户 hhvm 运行 HHVM,因为它是默认设置。但是当尝试将用户更改为 nginx 时,我在检查其状态时遇到错误。
$ vim /usr/lib/systemd/system/hhvm.service
我添加以下内容
[Unit]
Description=HipHop Virtual Machine (FCGI)
[Service]
ExecStart=/usr/local/bin/hhvm -c /etc/hhvm/server.ini -c /etc/hhvm/php.ini --user nginx --mode daemon
[Install]
WantedBy=multi-user.target
关于配置文件
$ vim /etc/hhvm/server.ini
这就是我的配置
pid = /var/run/hhvm/pid
hhvm.server.ip = 127.0.0.1
hhvm.server.port = 9000
;hhvm.server.file_socket = /var/run/hhvm/hhvm.sock
hhvm.server.user = nginx
hhvm.server.type = fastcgi
hhvm.server.default_document = index.php
hhvm.source_root = /srv/www/public_html
hhvm.server.always_use_relative_path = false
hhvm.server.thread_count = 32
hhvm.resource_limit.max_socket = 65536
hhvm.jit = true
hhvm.jit_a_size = 67108864
hhvm.jit_a_stubs_size = 22554432
hhvm.jit_global_data_size = 22554432
hhvm.jit_profile_interp_requests = 3
; mysql
hhvm.mysql.socket = /var/lib/mysql/mysql.sock
hhvm.mysql.typed_results = true
; logging
hhvm.log.use_syslog = false
hhvm.log.use_log_file = true
hhvm.log.file = /var/log/hhvm/error.log
hhvm.log.level = Warning
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
之后我运行命令
$ systemctl daemon-reload
$ systemctl start hhvm.service
$ systemctl status hhvm.service
当我检查状态时,我收到以下消息
hhvm.service - HipHop Virtual Machine (FCGI)
Loaded: loaded (/usr/lib/systemd/system/hhvm.service; enabled)
Active: failed (Result: exit-code) since Fri 2015-04-10 23:43:00 CEST; 2s ago
Process: 2545 ExecStart=/usr/local/bin/hhvm -c /etc/hhvm/server.ini -c /etc/hhvm/php.ini --user nginx --mode daemon (code=exited, status=1/FAILURE)
Main PID: 2545 (code=exited, status=1/FAILURE)
Apr 10 23:43:00 centos7.local systemd[1]: Starting HipHop Virtual Machine (FCGI)...
Apr 10 23:43:00 centos7.local systemd[1]: Started HipHop Virtual Machine (FCGI).
Apr 10 23:43:00 centos7.local systemd[1]: hhvm.service: main process exited, code=exited, status=1/FAILURE
Apr 10 23:43:00 centos7.local systemd[1]: Unit hhvm.service entered failed state.
而且每次重启时我都必须手动创建这个文件夹
$ mkdir /var/run/hhvm
为什么会自动删除?
【问题讨论】:
-
CentOS 7 上的预编译包也有同样的问题。此外,我发现 hhvm 实际上以 root 身份运行和访问文件。
标签: hhvm