{"id":208778,"date":"2014-01-12T12:58:03","date_gmt":"2014-01-12T08:58:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=208778"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=208778","title":{"rendered":"<span class=\"post_title\">HHVM, Nginx \u0438 PHP (\u0430 \u0442\u0430\u043a\u0436\u0435 Laravel)<\/span>"},"content":{"rendered":"<div class=\"content html_format\">       <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/b6f\/6ec\/5b7\/b6f6ec5b74ea0098c0e0ab3e7c2b00ab.png\" alt=\"HHVM + Nginx + PHP + Laravel\" align=\"left\"\/>\u041c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043b\u044e\u0434\u0435\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 HHVM \u043d\u0430 Nginx \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441 Laravel. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c.<\/p>\n<p>  <i><b>HHVM (\u0438\u043b\u0438 HipHop Virtual Machine)<\/b> \u2014 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0442\u043e\u0440 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0435\u0439 Facebook. HipHop \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 PHP, \u0432 \u0432\u044b\u0441\u043e\u043a\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 C++, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 g++ \u0434\u043b\u044f \u0435\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438.<\/i><\/p>\n<h5>\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h5>\n<p>  \u041a\u0430\u043a \u0438 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u043c\u043e\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439, \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Ubuntu 12.04 LTS \u043a\u0430\u043a \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u0434\u043e\u0431\u0440\u0430. \u041e\u0434\u043d\u0430\u043a\u043e, \u043c\u044b \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u044d\u0442\u043e \u0432\u0441\u0435 \u043d\u0430 Mac \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Brew (<a href=\"http:\/\/learnaholic.me\/2012\/10\/10\/installing-nginx-in-mac-os-x-mountain-lion\/\">nginx<\/a> \u0438 <a href=\"https:\/\/github.com\/facebook\/hhvm\/wiki\/Building-and-installing-HHVM-on-OSX-10.8\">hhvm<\/a>). \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 HHVM \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b (\u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043d\u043e\u0432\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 Ubuntu) \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0439\u0434\u0435\u043d\u0430 <a href=\"http:\/\/www.hhvm.com\/blog\/1817\/fastercgi-with-hhvm\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  \u041d\u0443 \u0447\u0442\u043e \u0436\u0435, \u043f\u043e\u0435\u0445\u0430\u043b\u0438!<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h5>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043e\u0441\u043d\u043e\u0432\u044b<\/h5>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0432\u0435\u0449\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0446\u0435\u043b\u0438:<\/p>\n<pre><code class=\"bash\">$ sudo apt-get update $ sudo apt-get install -y unzip vim git-core curl wget build-essential python-software-properties <\/code><\/pre>\n<h5>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Nginx<\/h5>\n<p>  \u0414\u0430\u043b\u0435\u0435, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c Nginx. \u041f\u043e\u0447\u0435\u043c\u0443 \u043e\u043d \u0438\u0434\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u043c? \u0422\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 <b>hhvm-fastcgi<\/b>, \u043e\u043d [\u043f\u0430\u043a\u0435\u0442] \u0438\u0437\u043c\u0435\u043d\u0438\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Nginx, \u0435\u0441\u043b\u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442 \u0435\u0433\u043e.<\/p>\n<pre><code class=\"bash\">$ sudo apt-get install -y nginx <\/code><\/pre>\n<h5>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 HHVM FastCGI<\/h5>\n<p>  \u0421\u0443\u0434\u044f \u043f\u043e <a href=\"http:\/\/www.hhvm.com\/blog\/1817\/fastercgi-with-hhvm\">\u0431\u043b\u043e\u0433\u0443 HHVM<\/a> \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c HHVM \u0441 FastCGI. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 HHVM \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 FastCGI.<\/p>\n<pre><code class=\"bash\">$ 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 <\/code><\/pre>\n<p>  <i>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/i> \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0444\u043b\u0430\u0433 <b>&#8212;force-yes<\/b> \u0434\u043b\u044f \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<h5>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 HHVM<\/h5>\n<p>  HHVM \u044d\u0442\u043e \u043f\u043e \u0441\u0443\u0442\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f PHP, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c PHP \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e. \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c HHVM \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 PHP. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c php-\u0444\u0430\u0439\u043b\u044b:<\/p>\n<pre><code class=\"bash\">$ hhvm some_file.php <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0443 \u043d\u0430\u0441, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0435\u0441\u0442\u044c Composer \u0438 PHPUnit, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0438\u043c\u043b\u0438\u043d\u043a php \u043d\u0430 hhvm:<\/p>\n<pre><code class=\"bash\">$ sudo ln -s `which hhvm` \/usr\/local\/bin\/php <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c PHP \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e!<\/p>\n<pre><code class=\"bash\">$ php -v HipHop VM v2.3.2 (rel) Compiler: tags\/HHVM-2.3.2-0-gf951cb8d8812c59344d5322454853b584b668636 Repo schema: 5b5a4fc9cde5a5d014d1dfdb491bf74e4e700131 <\/code><\/pre>\n<h5>HHVM Fast-CGI<\/h5>\n<p>  \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e <a href=\"http:\/\/www.vagrantup.com\">Vagrant<\/a>, \u0438 \u044f \u0445\u043e\u0447\u0443, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0438\u043c \u043a\u043e\u0440\u043d\u0435\u0432\u044b\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u043c \u0431\u044b\u043b\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \/vagrant. \u0414\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0440\u043d\u044f, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u0430\u043a HHVM, \u0442\u0430\u043a \u0438 Nginx.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 HHVM. \u0424\u0430\u0439\u043b \u0434\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f: \/etc\/hhvm\/server.hdf \u0412\u043e\u0442 \u043e\u0434\u043d\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"bash\"># Change doc root from \/var\/www\/ to \/vagrant\/ $ sudo sed -i 's\/SourceRoot = \\\/var\\\/www\\\/\/SourceRoot = \\\/vagrant\\\/\/' \/etc\/hhvm\/server.hdf  <\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c HHVM \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439:<\/p>\n<pre><code class=\"bash\">$ sudo service hhvm-fastcgi restart <\/code><\/pre>\n<h5>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c Nginx<\/h5>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c Nginx. \u042f \u0441\u043e\u0437\u0434\u0430\u043c \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <b>vagrant:<\/b><\/p>\n<pre><code class=\"bash\"># Create and edit our new configuration file $ sudo vim \/etc\/nginx\/sites-available\/vagrant <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u044d\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"nginx\">\/\/  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;     } } <\/code><\/pre>\n<h5>\u0414\u0432\u0430 \u0432\u0430\u0436\u043d\u044b\u0445 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f<\/h5>\n<p>  <b>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445,<\/b> \u043c\u044b \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0431\u043b\u043e\u043a <i>location<\/i>. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Nginx \u0434\u043e HHVM \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c HHVM \u0443\u0432\u0438\u0434\u0435\u0442\u044c Nginx \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b \/etc\/nginx\/hhvm.conf \u0434\u043b\u044f \u0432\u0430\u0441. \u0424\u0430\u0439\u043b hhvm.conf, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c, \u0443\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u0431\u043b\u043e\u043a location, \u043d\u0443\u0436\u043d\u044b\u0439 PHP.<br \/>  <b>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445,<\/b> \u0444\u0430\u0439\u043b hhvm.conf \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \/var\/www. \u042d\u0442\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 <i>root\/vagrant.<\/i> \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u044d\u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0448 vagrant-\u0444\u0430\u0439\u043b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u043b \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043f\u0443\u0442\u0435\u043c \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b root \u0432 \u0444\u0430\u0439\u043b\u0435 hhvm.conf:<\/p>\n<pre><code class=\"bash\">$ sudo vim \/etc\/nginx\/hhvm.conf # Then comment out the line 'root \/var\/www' and save <\/code><\/pre>\n<p>  \u0421\u0430\u043c \u0444\u0430\u0439\u043b \/etc\/nginx\/hhvm.conf:<\/p>\n<pre><code class=\"nginx\">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; } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u043a\u043b\u044e\u0447\u0438\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u0438:<\/p>\n<pre><code class=\"bash\">$ sudo ln -s \/etc\/nginx\/sites-available\/vagrant \/etc\/nginx\/sites-enabled\/vagrant <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c HHVM-FastCGI \u0438 Nginx \u0434\u043b\u044f \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f \u0432 \u0441\u0438\u043b\u0443 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u041d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 php-\u0444\u0430\u0439\u043b.<\/p>\n<h5>\u041d\u0435\u043c\u043d\u043e\u0433\u043e PHP<\/h5>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"bash\">$ vim \/vagrant\/index.php <\/code><\/pre>\n<p>  \u0427\u0442\u043e-\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0432\u0440\u043e\u0434\u0435 \u044d\u0442\u043e\u0433\u043e:<\/p>\n<pre><code class=\"php\">&lt;?php echo phpinfo(); \/\/ Expected output: HipHop <\/code><\/pre>\n<p>  \u0414\u0435\u043b\u043e \u0437\u0430 \u043c\u0430\u043b\u044b\u043c. \u041f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c hhvm-fastcgi \u0438 nginx. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e, \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c index.php \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a IP-\u0430\u0434\u0440\u0435\u0441\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 (\u0438\u043b\u0438 \u043a 192.168.33.10.xip.io, \u0435\u0441\u043b\u0438 \u0432\u044b \u044e\u0437\u0430\u0435\u0442\u0435 <a href=\"https:\/\/github.com\/fideloper\/Vaprobash\">Vaprobash<\/a>) \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435.<\/p>\n<pre><code class=\"bash\">$ sudo service hhvm-fastcgi restart $ sudo service nginx reload <\/code><\/pre>\n<p>  \u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u00abHipHop\u00bb \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435.<\/p>\n<h5>Laravel<\/h5>\n<p>  \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u041b\u0430\u0440\u0430\u0432\u0435\u043b\u0430 \u043d\u0438\u0447\u0435\u043c \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043e\u043d\u043e\u0433\u043e. \u0421 \u0442\u0435\u0445 \u043f\u043e\u0440, \u043a\u0430\u043a \u043c\u044b \u0441\u0438\u043c\u043b\u0438\u043d\u043a\u043d\u0443\u043b\u0438 PHP, \u0432\u0441\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u0447\u0430\u0441\u044b. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c.<\/p>\n<h5>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Composer<\/h5>\n<p>  \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u044b\u043a\u043d\u043e\u0432\u0435\u043d\u043d\u0430\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u044f:<\/p>\n<pre><code class=\"bash\">$ curl -sS https:\/\/getcomposer.org\/installer | php $ sudo mv composer.phar \/usr\/local\/bin\/composer <\/code><\/pre>\n<h5>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Laravel<\/h5>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 laravel-\u043f\u0440\u043e\u0435\u043a\u0442. \u042f \u043d\u0430\u0437\u043e\u0432\u0443 \u0435\u0433\u043e hhlaravel:<\/p>\n<pre><code class=\"bash\"># Move to \/vagrant so we install Laravel # into \/vagrant\/hhlaravel $ cd \/vagrant $ composer create-project laravel\/laravel hhlaravel <\/code><\/pre>\n<p>  \u041c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043f\u0438\u0442\u044c \u0447\u0430\u044f \u0438\u043b\u0438 \u043a\u043e\u0444\u0435, \u043f\u043e\u043a\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \ud83d\ude42<\/p>\n<h5>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0448\u0430\u0433: \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Laravel<\/h5>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u0442\u0432\u0438\u043a \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0432 \/public:<\/p>\n<pre><code class=\"bash\"># 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 <\/code><\/pre>\n<p>  \u0412\u0441\u0435 \u0433\u043e\u0442\u043e\u0432\u043e! \u041c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430.<\/p>\n<h5>\u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0435\u0440\u0435\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f<\/h5>\n<p>  \u0412\u0430\u043c \u0437\u0430\u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0443\u0434\u0435\u043b\u044f\u0442\u044c \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043d\u0430 \u043b\u043e\u0433\u0438 \u043e\u0448\u0438\u0431\u043e\u043a. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, HHVM \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043d\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442. \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043b\u043e\u0433 \u043b\u0430\u0440\u0430\u0432\u0435\u043b\u0430:<\/p>\n<pre><code class=\"bash\"># Show last 50 lines written out to laravel log $ tail -n 50 -f \/vagrant\/hhlaravel\/app\/logs\/laravel.log <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043b\u043e\u0433 HHVM:<\/p>\n<pre><code class=\"bash\">$tail -n 50 -f \/var\/log\/hhvm\/error.log <\/code><\/pre>\n<p>  \u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c stack trace \u0432 \u0432\u0430\u0448\u0438 \u043b\u043e\u0433\u0438 \u043f\u0443\u0442\u0435\u043c <a href=\"https:\/\/github.com\/facebook\/hhvm\/wiki\/runtime-options\">\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/a>.<\/p>\n<p>  \u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 <b>\/etc\/hhvm\/server.hdf<\/b> \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b <b>InjectedStackTrace<\/b> \u0438 <b>NativeStackTrace.<\/b>  <\/p>\n<pre><code class=\"nginx\">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 \\&quot;%r\\&quot; %&gt;s %b     }   } } <\/code><\/pre>\n<p>  \u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430 \u0432 \u043e\u043a\u043d\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u043f\u0443\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a Debug&#8217;\u0430 \u0432 \/etc\/hhvm\/server.hdf:<\/p>\n<pre><code class=\"nginx\">Debug {  FullBacktrace = true  ServerStackTrace = true  ServerErrorMessage = true  TranslateSource = true } <\/code><\/pre>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u0436\u0443\u0440\u043d\u0430\u043b\u044b \u043e\u0448\u0438\u0431\u043e\u043a \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435. \u0417\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044f \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 <a href=\"http:\/\/miles-by-motorcycle.com\/fv-b-8-657\/configuring-and-using-the-hiphopvm--hhvm--remote-debugger\">remote debugger&#8217;\u0430 \u0434\u043b\u044f HHVM<\/a> (\u043d\u0430 \u0441\u0435\u0431\u0435 \u043d\u0435 \u0438\u0441\u043f\u044b\u0442\u044b\u0432\u0430\u043b).   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/208778\/\"> http:\/\/habrahabr.ru\/post\/208778\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">       <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/b6f\/6ec\/5b7\/b6f6ec5b74ea0098c0e0ab3e7c2b00ab.png\" alt=\"HHVM + Nginx + PHP + Laravel\" align=\"left\"\/>\u041c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043b\u044e\u0434\u0435\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 HHVM \u043d\u0430 Nginx \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441 Laravel. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c.<\/p>\n<p>  <i><b>HHVM (\u0438\u043b\u0438 HipHop Virtual Machine)<\/b> \u2014 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0442\u043e\u0440 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0435\u0439 Facebook. HipHop \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 PHP, \u0432 \u0432\u044b\u0441\u043e\u043a\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 C++, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 g++ \u0434\u043b\u044f \u0435\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438.<\/i><\/p>\n<h5>\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h5>\n<p>  \u041a\u0430\u043a \u0438 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u043c\u043e\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439, \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Ubuntu 12.04 LTS \u043a\u0430\u043a \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u0434\u043e\u0431\u0440\u0430. \u041e\u0434\u043d\u0430\u043a\u043e, \u043c\u044b \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u044d\u0442\u043e \u0432\u0441\u0435 \u043d\u0430 Mac \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Brew (<a href=\"http:\/\/learnaholic.me\/2012\/10\/10\/installing-nginx-in-mac-os-x-mountain-lion\/\">nginx<\/a> \u0438 <a href=\"https:\/\/github.com\/facebook\/hhvm\/wiki\/Building-and-installing-HHVM-on-OSX-10.8\">hhvm<\/a>). \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 HHVM \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b (\u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043d\u043e\u0432\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 Ubuntu) \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0439\u0434\u0435\u043d\u0430 <a href=\"http:\/\/www.hhvm.com\/blog\/1817\/fastercgi-with-hhvm\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  \u041d\u0443 \u0447\u0442\u043e \u0436\u0435, \u043f\u043e\u0435\u0445\u0430\u043b\u0438!  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-208778","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/208778","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=208778"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/208778\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=208778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=208778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=208778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}