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