Saturday 23 January 2016

zend framework - Require_Once gives PHP Division By Zero Error



I'm trying to require a config file in index.php by using:




require_once __DIR__/application/common/config/Config.php;


However, PHP error logs state division by zero. The full path is /var/www/application/common/config/Config.php



How do I ensure this path is correctl represented in my require_once statement?


Answer



You need to use quotes for strings in PHP...



require_once __DIR__ . '/application/common/config/Config.php';


No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...