2.10.15. Running scripts requiring ionCube, Zend Encoder, Memcache (d) or Redis

To run through console or cron script that requires to work ionCube, Zend Encoder, Memcache(d), Redis or other modules plugged into PHP settings, it is necessary in the start command:

  1. Specify the path to the PHP interpreter of the same version as installed in the settings of the site in the directory of which the script to be launched is located.
  2. Specify the path to the php.ini of the site in the directory of which the script to run is located.

Paths to PHP interpreters of all available versions:

/usr/local/php4/bin/php
/usr/local/php52/bin/php
/usr/local/php53/bin/php
/usr/local/php54/bin/php
/usr/local/php55/bin/php
/usr/local/php56/bin/php
/usr/local/php70/bin/php
/usr/local/php71/bin/php
/usr/local/php72/bin/php
/usr/local/php73/bin/php
/usr/local/php74/bin/php
/usr/local/php80/bin/php
/usr/local/php81/bin/php

The path to the php.ini of the site looks like this:

/home/account/.system/php/www.example.com.ini

On my way:

  • Instead account should be hosting account namewhere the script to run is located.
  • Instead www.example.com there must be the name of the site / subdomain in the directory of which the script to run is placed.

The launch command itself looks like this:

/usr/local/php72/bin/php -c /home/account/.system/php/www.example.com.ini -f path/to/script.php

In a team:

  • /usr/local/php72/bin/php - the path to the PHP interpreter of the required version.
  • -c - the key followed by the path to php.ini desired site.
  • /home/account/.system/php/www.example.com.ini - way to php.ini desired site.
  • -f — a key followed by the path to the script being launched.
  • path/to/script.php - the path to the script to run.

Warning!

If you run the script without observing the conditions listed above, an error will be displayed that ionCube is not installed, the Memcache or Redis class is missing, etc.
Content