core php functions missing?

Web hosting discussion, programming, and shared and dedicated servers.
4 posts Page 1 of 1
by pvg » Thu Aug 09, 2012 5:52 pm
Hi,

I have some simple code that works fine on a DreamHost server, but not on a Sonic.net server.

The reported error is
Call to undefined function gregoriantojd()
According to this site:
http://php.net/manual/en/function.gregoriantojd.php
the function should be built in as of PHP v4.

Here is the code running on website hosted on a DreamHost server:
http://chessclubforkids.com/calendar-jo ... hsubmit=Go!

Same code running on Sonic.net server:
http://dream-create-communicate.com/cal ... hsubmit=Go!

Thoughts?
I don't want to leave Sonic!!!!
But I am a programmer and must write code from time to time! : )

Thanks in advance!
by rodrigo » Fri Aug 10, 2012 8:54 am
gregoriantojd() is not a core php function, it's part of a calendar functions extension. The breadcrumb over on the left shows the hierarchy of the section you're in:

PHP -> Function Reference -> Date and Time Related Extensions -> Calendar -> Calendar Functions

http://www.php.net/manual/en/intro.calendar.php

We don't have php compiled with the calendar extension, so you may need to write your own implementation of that function or find another workaround. The equations for conversion (both ways) don't seem too rough:

http://en.wikipedia.org/wiki/Julian_day ... Day_Number
by williamt » Fri Aug 10, 2012 3:53 pm
I will add this with the next php update. This should happen early next week for php 5.3.15
Sr. Systems Administrator @ sonic.net
by williamt » Mon Aug 13, 2012 11:08 am
PHP has been upgraded and calendar support has been enabled.
Please note that you must be using php 5.3 for this to work.

Please refer to our wiki to enable php 5.3 if you don't have it enabled.
https://wiki.sonic.net/wiki/Php5

Thanks,
William
Sr. Systems Administrator @ sonic.net
4 posts Page 1 of 1

Who is online

In total there are 18 users online :: 0 registered, 0 hidden and 18 guests (based on users active over the past 5 minutes)
Most users ever online was 999 on Mon May 10, 2021 1:02 am

Users browsing this forum: No registered users and 18 guests