Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal error: Call to undefined function easter_date()

Tags:

php

I'm trying to get the easter_date from this year. This is my code:

<?php
$year = date ("Y");
$easter = date ("d-M-Y", easter_date ($year));
echo "Easter " . $year . ": " . $easter . "";
?>

When I execute the code following error appears: Fatal error: Call to undefined function easter_date() in

My phpVersion is 5.3.3. I'm using Linux(Ubuntu).

Have you got an idea what is missing?

like image 543
Faili Avatar asked Mar 14 '11 11:03

Faili


3 Answers

If you use a Dockerfile based on php:7.1, you can install the calendar extension easily:

RUN docker-php-ext-install calendar && docker-php-ext-configure calendar
like image 73
A.L Avatar answered Nov 15 '22 09:11

A.L


Seems like your php has been compiled without --enable-calendar support

http://ru.php.net/manual/en/calendar.installation.php

like image 34
zerkms Avatar answered Nov 15 '22 09:11

zerkms


I simply had to enable the calendar extension in php.ini:

extension = calendar.so
like image 32
dmoebius Avatar answered Nov 15 '22 09:11

dmoebius