Binary Expressions

2007-11-1

PHP Calendar Functions Error

Filed under: — The Warden @ 11:56 am

I was trying to use the PHP calendar API and immediately received this error message, “Fatal error: Call to undefined function cal_days_in_month()”. This error message means PHP was not compiled with the calendar extension.

Solution


The only solution to this error message and other similar error messages relating to the PHP calendar API requires PHP to be compiled with the calendar extension by adding “–enable-calendar” to the “configure command” as stated in the PHP documentation on the Calendar functions page.

How to Tell if the Calendar Extension is Installed


You can verify weather or not the PHP Calendar extension was compiled at install by using the phpinfo() function. When viewing the output of phpinfo() look under “Configure Command” just below “Build Date” and if you do not see “–enable-calendar” present then all PHP Calendar functions will not work.

Configure Example


./configure –with-mysql=/usr/local –with-mssql=/usr/local –with-apxs –with-zlib-dir=/usr/lib –with-libxml-dir=/usr/local –with-config-file-path=/var/www/conf –with-iconv=/usr/local/bin/iconv –enable-exif –-enable-mbstring –enable-calendar

Leave a Reply

Take back your mailbox - CAUCE.org

Powered By Wordpress PHP: Hypertext Preprocessor MySQL Powered Download Juice, the cross-platform podcast receiver
Proud To Be Canadian Get Firefox Valid XHTML Valid CSS
<NO>OOXML Logo


24 queries. 0.249 seconds.
Copyright © 2004 - 2005 by Adam Douglas