Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note
iconfalse
titleNote: This requires editing the shell script, which requires the Unix/Linux style end-of-line.

Please use a Unix/Linux aware editor like Zend Studio or Notepad ++ to edit the file. Do not use Notepad, it will convert the end-of-line to Windows style, and php-cli will stop working, with a 'not found' error.  Also, please BACK UP THIS FILE before changing it, so you can restore it if you can't change it back with the editor for any reason.

Zend Server versions 2020.x, 2021.x 

The file to change is: /usr/local/zendphp74/bin/php-cli

After you BACK UP this file, open it in a Unix safe editor. It will look like this:

Info
iconfalse
#!/bin/sh
if [ -f /usr/local/zendphp74/etc/zce.rc ];then
. /usr/local/zendphp74/etc/zce.rc
else
echo '/usr/local/zendphp74/etc/zce.rc doesn't exist!'
exit 1;
fi
LIBPATH=$ZCE_PREFIX/lib
$ZCE_PREFIX/bin/php.bin '$@'

Add the export just before the last line, so now it looks like this (red highlight added for emphasis, you don't need to make the line red):

Info
iconfalse
#!/bin/sh
if [ -f /usr/local/zendphp74/etc/zce.rc ];then
. /usr/local/zendphp74/etc/zce.rc
else
echo '/usr/local/zendphp74/etc/zce.rc doesn't exist!'
exit 1;
fi
LIBPATH=$ZCE_PREFIX/lib
export LANG=C
$ZCE_PREFIX/bin/php.bin '$@'

Save the change.  Since this is php-cli, there is no need to restart Apache or anything.  Just run your script with php-cli to see the changed behavior.

Zend Server versions 9.1.x, 2018.0.x and 2019.0.x

...

The file to change is: /usr/local/zendphp7/bin/php-cli

...

Save the change.  Since this is php-cli, there is no need to restart Apache or anything.  Just run your script with php-cli to see the changed behavior.

Zend Server Versions 6 - 8.5.x

The file to change is:  /usr/local/zendsvr6/bin/php-cli

...