GreenArrow Documentation

Special Sending Rules PHP Path

Disclaimer

This configuration is only available for customers with an on-premise license.

It’s possible to use a version of PHP for Special Sending Rules other than the one shipped with GreenArrow Engine.

  1. On Centos 7, you can install PHP 7 from the Remi packages:

     yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
     yum-config-manager --enable remi-safe
     yum install php70 php70-php-devel php70-php-pecl-redis php70-php-mbstring php70-php-process
     yum-config-manager --disable remi-safe
    

    Alternatively, on other systems or for other versions of PHP, install PHP from source:

     # Assuming you're inside the PHP source dir that you wish to install...
     ./configure --prefix=/usr/local/php-7.0 --enable-mbstring --with-curl --with-gd
     make
     make install
    
  2. Not required for Remi installations Install phpredis:

    For PHP 7, at the current time a special branch of phpredis is required. For example, if your PHP 7 installation is at /usr/local/php-7.0:

     git clone https://github.com/phpredis/phpredis.git -b php7 /usr/local/src/phpredis
     cd /usr/local/src/phpredis
     /usr/local/php-7.0/bin/phpize
     ./configure --with-php-config=/usr/local/php-7.0/bin/php-config
     make
     make install
    
  3. Write the PHP 7 binary path to Studio’s configuration file.

    For Remi installations:

     echo /opt/remi/php70/root/usr/bin/php > /var/hvmail/control/opt.studio.ssr.php_path
    

    Otherwise, write the path to the php binary as you previously installed above:

     echo /usr/local/php-7.0/bin/php > /var/hvmail/control/opt.studio.ssr.php_path
    
  4. Send a test campaign that uses Special Sending Rules.

    Here’s a special sending rule that writes PHPINFO for confirmation of version:

    return array_map((function ($recipient) use ($campaign_information_hash) {
      ob_start();
      phpinfo();
      $phpinfo = ob_get_contents();
      ob_end_clean();

      return array(
        'html'              => "",
        'text'              => "PHP INFO\n\n$phpinfo",
        'subject'           => "PHP INFO",
      );
    }), $multiple_recipients_information_hash);