WordPress: call to undefined function get_option()

So I finally got around to installing WordPress; all seemed fine until I deployed to my live server and tried to log into the Admin panel.  After doing so, I hit the following error:

Fatal error: Call to undefined function get_option() in …/wp-admin/admin.php on line xyz.

After doing some research, it seems like a lot of folks have hit this problem.  Googling the error surfaced 2 common fixes:

  • deleting trailing spaces from the wp-config.php and functions.php files
  • re-uploading the entire Word Press installation (seems as if Word Press files have a way of becoming corrupt during their upload, which sounds odd)

Neither of those worked for me, but after suspecting the issue had something to do with php 5.3 and calls to include_once, my Google-fu uncovered this post:

http://wordpress.org/support/topic/wp-301-apc-314-php-533-white-wp-adnmin-page

So, it turns out that my issue was due to having php 5.3 and a specific version of APC installed.  After setting this APC directive in my apc.ini:

apc.include_once_override = 0

… all is well again! Hopefully this saves someone the hours of research, debugging, and frustration that I went through!

This entry was posted in General. Bookmark the permalink.

9 Responses to WordPress: call to undefined function get_option()

  1. Derek says:

    Marco,

    Thank you! Finally solved my problem. Only spent a couple hours trying to solve it.

  2. Andrei says:

    Thanks!

    It seems to be very particular bug.

    Solved my problem

  3. Enjay says:

    Fantastic! Thank you very much!

  4. Pavlos says:

    You really ARE a life-saver.

    Many thanks!

  5. Shahzad says:

    do not understand how to configure apc.ini. Please tell me where this file is located?

    • mzarate says:

      Hey Shahzad,

      You can try 2 options:

      1) From a terminal you can use locate:

      locate apc.ini

      2) Or, pull up a phpinfo() page and search for apc.ini. Mine is listed in a section titled Additional .ini files parsed (which cites /etc/php.d/apc.ini)

      Does that help?

  6. Thanks for posting your solution, saved me a lot of headache.

  7. Thank you! I had enabled this (admittedly experimental) APC feature for performance reasons, without realising it breaks WordPress. All better now!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>