Loganathan Natarajan
asked on
How do I fix this error on my hosting server?
I have cakephp application which runs on LAMP environment. when i run the below error shows ,
The php code is,
PHP Notice: Undefined index: HTTP_HOST in /var/www/test234/as/test.php on line 120
TERM environment variable not set.
The php code is,
if ($_SERVER['HTTP_HOST'] == 'xxc34-xx-xx-xx-cc.xxxx-1.amazonaws.com' && !in_array($_SERVER['REMOTE_ADDR'], array('238.12.43.1', '127.0.0.1','192.168.0.100'))) {
$config['xx']['is_xxx_xx_enabled'] = false;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
One more, I forgot to tell you,
When I run through browser , there is no Notice...
but when I run through cron job , the above notice printed on the error.log?
When I run through browser , there is no Notice...
but when I run through cron job , the above notice printed on the error.log?
ASKER
I checked it and it is there at the bottom.
I think problem might be when I run through cron job , the above notice printed on the error.log?
If it is Notice, then it is OK.
I think problem might be when I run through cron job , the above notice printed on the error.log?
If it is Notice, then it is OK.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Its because cake PHP need certain PHP modules that need to be installed and enabled that are not present in your PHP enviornment such as MBstring, PDO etc Please check PHP Cake requirement page and install them.
ASKER
Thanks
Running my PHP program above on the command line gives me Environment variables but not $_SERVER web server variables which makes sense because it's not running thru the web server. That's true on both Windows and Linux.
On my server, $_SERVER['HTTP_HOST'] === $_ENV['HTTP_HOST']
Neither one of the systems where I can run PHP at the command line, 1 Windows, 1 Linux, report the 'HTTP_HOST' in the environment info.
ASKER