1

A template caused my site to behave weird and only the header was loaded. I discovered that there are a few lines calling the function easter_date. If the function is getting called then my site breaks.

So the function does not seem to exist. So I added the line if (!is_callable('easter_date')) return false; and it actually returned false.

I am running on PHP 5.6.40. It says that easter_date is available in PHP 4, 5 and 7

Why does easter_date not exist?

Example Code:

    $easter_d = date("d", easter_date($datum[0]));
    $easter_m = date("m", easter_date($datum[0]));
3
  • 1
    Add a `\` before the function for it look in the global namespace. See if that solves it. Commented Mar 26, 2019 at 15:38
  • 3
    The function is part of the calendar extension, see its manual: php.net/manual/en/calendar.installation.php Commented Mar 26, 2019 at 15:39
  • 1
    You never provided a snippet of your code. Commented Mar 26, 2019 at 15:43

1 Answer 1

2

Try the following:

  1. Ensure you have installed the extension
  2. Try and add a \ before the function to make it search the global namespace for the function
Sign up to request clarification or add additional context in comments.

1 Comment

Is there a way to install the extension after php is already installed? I am running on linux

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.