If anyone is trying to install and run Post Affiliate Pro or Post Affiliate Network on HHVM server, it won't work without a special setup. Currently there is no option to run PHP loaders (IonCube or ZendGuard) on HHVM server so you need to set up a rule on your server using which you will run all PAP/PAN files via PHP server and not via HHVM server. You can use the following code (goes to a conf file in nginx, but the same theory should work with htaccess etc) :
location ~ /affiliate(.*).php$ {
# PAP installation path (change 'affiliate' to whatever path PAP is coming from)
# It get's served by PHP-FPM (as ionCube isn’t compatible with HHVM)
expires off;
fastcgi_pass 127.0.0.1:9000;
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
fastcgi_connect_timeout 60s;
fastcgi_read_timeout 60s;
fastcgi_send_timeout 60s;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param MAGE_RUN_CODE default;
fastcgi_param MAGE_RUN_TYPE store;
fastcgi_param HTTPS on;
fastcgi_param HTTPS $fastcgi_https;
include fastcgi_params;
}
location ~ .php$ {
# All other php gets served by HHVM
expires off;
fastcgi_keep_conn on;
fastcgi_pass unix:/var/run/hhvm/sock;
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
fastcgi_connect_timeout 60s;
fastcgi_read_timeout 60s;
fastcgi_send_timeout 60s;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param MAGE_RUN_CODE default;
fastcgi_param MAGE_RUN_TYPE store;
fastcgi_param HTTPS on;
fastcgi_param HTTPS $fastcgi_https;
include fastcgi_params;
}
Another thing to get this to work, was to get the encoder(s) loading before other PHP modules. The easiest way to do this was to add a number at the beginning of the .ini filename:
Here is turned off the ioncube encoding as it uses zendguard loader.
If the opcache loads before the encoders then it causes issues.
Kudos goes to Jim.