PHP 常量(mysql 参数)并且包括不工作

PHP Constants (mysql parameter) and include not working

当我将以下 4 行直接放在 php 脚本中时 - 数据库连接正常

define('DB_HOST', 'localhost'); //change these
define('DB_USER', 'bpmspace_ipms'); // to required DB
define('DB_PSWD', 'PASSWDHERE'); //connection
define('DB_NAME', 'bpmspace_ipms_v1');

当我将 4 行复制到一个单独的文件中时。并尝试包含此文件数据库连接不工作

include_once('../../DB_config/login_credentials_DB_bpmspace_ipms.inc.php');

日志中的错误消息是

[Sun Jul 24 11:07:32.165303 2016] [:error] [pid 4354] [client]
PHP Notice:  Use of undefined constant DB_HOST - assumed 'DB_HOST' in

/var/www/IPMS/modules/ConnCrud.php 第 111 行,referer:....

注意:inlcude 正在运行 - 路径和文件名都可以。 error.log

中没有关于包含的错误消息

PHP 常量和包含有问题吗?

在另一个项目中,我在 "external" 文件中使用 php 变量,并且我没有问题可以包含...我不在这里使用它,因为这不是我的项目...

感谢抢劫的帮助

不要忘记包含文件开头的<?php

<?php
define('DB_HOST', 'localhost'); //change these
define('DB_USER', 'bpmspace_ipms'); // to required DB
define('DB_PSWD', 'PASSWDHERE'); //connection
define('DB_NAME', 'bpmspace_ipms_v1');