where to put php.ini?

I’ve uploaded an app to my host but some datetimezone functions aren’t working.

On my local linux I have php 5.3 which works fine. My host (hostgator) has php 5.2.

Hostgator has an option to use 5.3 by putting this in .htaccess




# use php 5.3

Action application/x-hg-php53 /cgi-sys/php53

AddType application/x-httpd-php53 .php



but now I get this error




Warning: CDbConnection::createPdoInstance() [cdbconnection.createpdoinstance]: 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 'America/Chicago' for 'CDT/-5.0/DST' instead in /home/englandr/yii/framework/db/CDbConnection.php on line 388


Fatal error: Class 'PDO' not found in /home/englandr/yii/framework/db/CDbConnection.php on line 388



Their advice is to create a php.ini file with:




[Date]

; Defines the default timezone used by the date functions

; http://php.net/date.timezone

date.timezone = Etc/UTC 



But I’m not sure where to put it? I’ve tried putting it in

/public_html/myapp/php.ini

and

/yii/myapp/php.ini

But it doesn’t appear to be picking it up.

Any ideas?

Thanks, Russ

You would need to ask them where to put it… but probably the best place is in the root of your account…

Try putting this in your index.php:


date_default_timezone_set('America/Chicago');

This is what I did because I was not able to edit php.ini. Just replace America/Chicago with your correct timezone.

@macinville - that worked thank you :)

But I still had problems with 5.3, so gave up - I’m trying to solve the date problems with 5.2 now.

Cheers, Russ

You can also try to put it into your .htaccess file:

php_value date.timezone ‘America/Chicago’