$ sudo apt-get update $ sudo apt-get install -y unzip vim git-core curl wget build-essential python-software-properties
$ sudo apt-get install -y nginx
$ echo deb http://dl.hhvm.com/ubuntu precise main | sudo tee /etc/apt/sources.list.d/hhvm.list $ sudo apt-get update $ sudo apt-get install -y --force-yes hhvm-fastcgi
$ hhvm some_file.php
$ sudo ln -s `which hhvm` /usr/local/bin/php
$ php -v HipHop VM v2.3.2 (rel) Compiler: tags/HHVM-2.3.2-0-gf951cb8d8812c59344d5322454853b584b668636 Repo schema: 5b5a4fc9cde5a5d014d1dfdb491bf74e4e700131
# Change doc root from /var/www/ to /vagrant/ $ sudo sed -i 's/SourceRoot = \/var\/www\//SourceRoot = \/vagrant\//' /etc/hhvm/server.hdf
$ sudo service hhvm-fastcgi restart
# Create and edit our new configuration file $ sudo vim /etc/nginx/sites-available/vagrant
// File /etc/nginx/sites-available/vagrant server { root /vagrant; index index.html index.htm index.php; server_name localhost; # 192.168.33.10.xip.io if you are using Vaprobash include hhvm.conf; # Include HHVM's configuration file for Nginx location / { try_files $uri $uri/ /index.php?q=$uri&$args; } location ~ /\.ht { deny all; } }
$ sudo vim /etc/nginx/hhvm.conf # Then comment out the line 'root /var/www' and save
location ~ \.php$ { # root /var/www fastcgi_keep_conn on; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name; include fastcgi_params; }
$ sudo ln -s /etc/nginx/sites-available/vagrant /etc/nginx/sites-enabled/vagrant
$ vim /vagrant/index.php
<?php echo phpinfo(); // Expected output: HipHop
$ sudo service hhvm-fastcgi restart $ sudo service nginx reload
$ curl -sS https://getcomposer.org/installer | php $ sudo mv composer.phar /usr/local/bin/composer
# Move to /vagrant so we install Laravel # into /vagrant/hhlaravel $ cd /vagrant $ composer create-project laravel/laravel hhlaravel
# Fast CGI document root $ sudo sed -i 's/SourceRoot = \/vagrant\//SourceRoot = \/vagrant\/hhlaravel\/public\//' /etc/hhvm/server.hdf # Nginx document root sudo sed -i 's/root \/vagrant;/root \/vagrant\/hhlaravel\/public;/' /etc/nginx/sites-available/vagrant # Reload configuration $ sudo service hhvm-fastcgi restart $ sudo service nginx reload
# Show last 50 lines written out to laravel log $ tail -n 50 -f /vagrant/hhlaravel/app/logs/laravel.log
$tail -n 50 -f /var/log/hhvm/error.log
Log { Level = Warning AlwaysLogUnhandledExceptions = true RuntimeErrorReportingLevel = 8191 UseLogFile = true UseSyslog = false File = /var/log/hhvm/error.log InjectedStackTrace = true NativeStackTrace = true Access { * { File = /var/log/hhvm/access.log Format = %h %l %u % t \"%r\" %>s %b } } }
Debug { FullBacktrace = true ServerStackTrace = true ServerErrorMessage = true TranslateSource = true }
Source: https://habr.com/ru/post/208778/
All Articles