Zend Framework 2 on IBM i/AS400

We have a tip for you if you want to run the source code from the book on IBM i / AS400 machine. One of our readers, Sven Weiss, pointed out that the code doesn’t work out of the box on those systems. It is a known issue, caused by the different behavior of the glob PHP function on that platform. The fix is very simple. You have to edit the application config file located at: config/application.config.php and replace these lines

'config_glob_paths' => array(
'config/autoload/{,*.}{global,local}.php',
),

with those:

'config_glob_paths' => array(
( !defined('GLOB_BRACE') ? getcwd().'/' : '').'config/autoload/{,*.}{global,local}.php',
),

We will try to provide a solution to the Zend Framework team, so that such a workaround is not needed in the future.

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha check * Time limit is exhausted. Please reload CAPTCHA.