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:


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.

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

  1. Derek says:


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

  2. Andrei says:


    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!

  8. Arya says:

    A bazzilion thanks!

    I removed that php.apc config line and now everything works like they should 🙂

  9. Meshack says:

    please, i made some corrections in my wp-config and all these started. please i need a step by step process to tackle this problem. it is an organisation site and it is down now. please i need your urgent help.

    • mzarate says:

      Hi Meshack,

      I couldn’t provide any insight other than what’s in this blog post, unfortunately. Have you tried reverting the changes you’ve made to wp-config.php to see what progress that yields?

  10. Matt Collins says:

    Thanks so much for providing this solution. This had me puzzled for ages. Finally my blog is working again!

  11. Guy Merritt says:

    Man – thanks for this….. I’d actually been messing with this for a couple of days and had just about given up. It wasn’t a production server – I was just horsing around on an older desktop version of Ubuntu (10.10) but I couldn’t figure out why APC was breaking WordPress. I still don’t understand it, from a technical perspective, but this absolutely worked…. Thanks a lot.

  12. Pingback: Compiling a LAMP server on Ubuntu 10.10 | Guysjoint.com

  13. Farzad says:

    I just want to say thank you. You’re great

Leave a Reply

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