I'm having some require_once()
issues.
Code:
<?php
$serverName = $_SERVER['SERVER_NAME'];
if ($serverName != 'xxx.xxx.xxx.xxx') {
require_once($_SERVER['DOCUMENT_ROOT'] . "/config.php");
} else {
require_once($_SERVER['SERVER_NAME'] . "/config.php");
}
?>
Errors/Warnings:
Warning: require_once() [function.require-once]: Unable to accesss xxx.xxx.xxx.xxx/config.php in /var/www/vhosts/site.com/httpdocs/inc/header.php on line 7
Warning: require_once(xxx.xxx.xxx.xxx/config.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/vhosts/site.com/httpdocs/inc/header.php on line 7
Fatal error: require_once() [function.require]: Failed opening required 'xxx.xxx.xxx.xxx/config.php' (include_path='.:') in /var/www/vhosts/site.com/httpdocs/inc/header.php on line 7
The config.php
file is being called in my header.php
file. Everything works great locally, but once it's on the live server, I just get the errors above.
Not sure if it matters, but I'm accessing this via IP address since it's a development site.
Yes, the config.php
files does exist in the root directory.
Any ideas?