GreenArrow Email Software 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. 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. 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);

Copyright © 2012–2024 GreenArrow Email