Skip to content

Instantly share code, notes, and snippets.

@colin-kiegel
Last active June 30, 2016 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save colin-kiegel/591840fcbce9d5eb7c78 to your computer and use it in GitHub Desktop.
Save colin-kiegel/591840fcbce9d5eb7c78 to your computer and use it in GitHub Desktop.
ILIAS / HHVM / Nginx configs
; /etc/hhvm/php.ini
; php options
session.save_handler = files
session.save_path = /var/lib/php5
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.level = Warning
hhvm.log.always_log_unhandled_exceptions = true ; (!)
hhvm.mysql.typed_results = false
hhvm.mysql.socket=/var/run/mysqld/mysqld.sock
; ILIAS - common settings
hhvm.libxml.ext_entity_whitelist = file ; avoid problem with DTD-Validation in Page-Editor (security-tradeoff)
hhvm.error_handling.call_user_handler_on_fatals = true ; <=> enable the error handler of ILIAS
hhvm.log.runtime_error_reporting_level = 22519 ; <=> corresponds to "error_reporting" in PHP
; 22517 = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED & ~E_WARNING
; 22519 = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
; 22527 = E_ALL & ~E_DEPRECATED & ~E_STRICT
; 8191 = E_ALL
; Developer settings
hhvm.debug.server_error_message = true ; <=> corresponds to "display_errors" in PHP - set it to 'true' on test systems
xdebug.enable=1
xdebug.remote_enable=1
xdebug.idekey="PHPSTORM"
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_dir = "/var/log/xdebug"
; /etc/hhvm/server.ini
; php options
pid = /var/run/hhvm/pid
; hhvm specific
hhvm.server.file_socket = /var/run/hhvm/sock ; a local UNIX-Socket has less overhead than using TCP
; hhvm.server.port = 9000
hhvm.server.type = fastcgi
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = /var/log/hhvm/error.log
hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc
; RepoAuthoritative Mode
; (support in ILIAS trunk is only experimental)
; requires precompiled bytecode repository which
; should be kept separate from standard repository
; hhvm.repo.authoritative = true
; hhvm.repo.central.path = /var/run/hhvm/precompiled/hhvm.hhbc
# /etc/nginx/hhvm.conf
# (!) changed fastcgi_pass from TCP to unix-socket
location ~ \.(hh|php)$ {
fastcgi_keep_conn on;
fastcgi_pass unix:/var/run/hhvm/sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# /etc/nginx/sites-available/default
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
###########################################
# /www/pub - with dual setup (PHP + HHVM) #
###########################################
# localhost:88 -> HHVM
server {
listen 88 default_server;
listen [::]:88 default_server ipv6only=on;
server_name localhost;
root /www/pub;
index index.php index.html index.htm;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
include hhvm.conf;
}
# localhost:80 -> PHP
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name localhost;
root /www/pub;
index index.php index.html index.htm;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
location ~ \.php$ {
fastcgi_keep_conn on;
# fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
# proxy_connect_timeout 600s;
# proxy_send_timeout 600s;
# proxy_read_timeout 600s;
fastcgi_send_timeout 600s;
fastcgi_read_timeout 600s;
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment