johnnyk Posted August 2, 2006 Share Posted August 2, 2006 Weird problem:I have a file that I include on every page of my site that looks like this:[code]<?phpdate_default_timezone_set('US/Eastern');//functions and variables and what not?>[/code]When I require() that file from a page, it loads fine. But when I require() that file from /cron/main.php (outside the public directory), I get an error that says something like "Call to undefined function date_default_timezone_set()".If it means anything, main.php is run by a...you guessed it...cron. main.php also require()s two other files, and they get included fine.Any idea?(Yay formatting!) Link to comment https://forums.phpfreaks.com/topic/16354-date_default_timezone_set/ Share on other sites More sharing options...
ronverdonk Posted August 2, 2006 Share Posted August 2, 2006 In some other form I saw the following tip:[quote]I did come across the putenv function $timeZone = "TZ=US/Eastern";putenv( $timeZone );seems to work for php date/time and sql statements.[/quote]Worth a try?Ronald 8) Link to comment https://forums.phpfreaks.com/topic/16354-date_default_timezone_set/#findComment-68075 Share on other sites More sharing options...
johnnyk Posted August 3, 2006 Author Share Posted August 3, 2006 I read that putenv() has some problems or something. But why isn't d_d_t_s() working with the cron? Link to comment https://forums.phpfreaks.com/topic/16354-date_default_timezone_set/#findComment-68234 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.