php header file error

images php coding issues or problems here.

Moderators: macek, egami, gesf

sbn
New php-forum User
New php-forum User
Posts: 2
Joined: Thu Mar 08, 2012 4:54 am

php header file error

Postby sbn » Thu Mar 08, 2012 5:37 am

I am new to php. I got a book that is training me on php, I wrote this program below and called the header file in it, it run fine in WAMP server on my second computer, but it generated error in another computer on which I install and configure Apache and PHP together. below is the programs and the error messages:
program
<html>
<head>
<title>header file</title>
</head>
<body>
<?php include "header.php" ?>
<?php
$r=3;
$y=6;
$sum=$r+$y;
echo $sum;
echo "<br>";
echo "The sum of the two variables is : ";
echo $sum;
?>
</body>
</html>

Header file:
<div alin="center"><font size="4"> Welcome to my movie review</font>
<br>
<?php
echo "Today is ";
echo date("F d");
echo ",";
echo date("Y");
?>
</div>

ERROR message:
Welcome to my movie review
Today is
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/London' for '0.0/no DST' instead in C:\Server\Apache\Apache2.2\htdocs\header.php on line 5
March 08,
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/London' for '0.0/no DST' instead in C:\Server\Apache\Apache2.2\htdocs\header.php on line 7
2012
9
The sum of the two variables is : 9

Can someone please help me out.

Thanks so much.

User avatar
egami
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: php header file error

Postby egami » Thu Mar 08, 2012 6:26 am

find the date.timezone variable in php.ini

should look a little something like this..
date.timezone = America/New_York

sbn
New php-forum User
New php-forum User
Posts: 2
Joined: Thu Mar 08, 2012 4:54 am

Re: php header file error

Postby sbn » Mon Mar 19, 2012 5:33 am

Thanks Egami.
I will look at the php ini, but what
should I do to correct this problem?
Once again thanks.


Return to “PHP coding => Images”

Who is online

Users browsing this forum: No registered users and 2 guests

cron