Tuesday 31 July 2018

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

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...