• Hi,
    I’m currently working on a plugin, and whenever I go to save its options apache on xampp crashes. I can’t really test my option saving method any other way, so I was wondering if anyone had run across this or might be able to look at my code (it’s not much, yet) to see what could possibly be causing it? If not, can someone recommend a good way to debug what line of php is causing it to crash — the only thing in the error log is it segfaulting. For reference, when I save options from a normal wordpress default page, it doesn’t crash, only when I save options from my plugin.
    Thanks,
    -Michael.
    P.S. almost forgot… dropbox link: https://www.dropbox.com/s/jhhrv5f1wf4zo8v/2mb-autocode.zip?dl=0

Viewing 4 replies - 1 through 4 (of 4 total)
  • QRZ

    You are discovering that developing code in this server and browser environment can be tricky, often several different languages in use, and in environments that keep you at arm’s length.

    What I do is output a running narrative of how the code is executing, where it has got to, and what values it has calculated. Because of the segfault, you will be examining where you got to before the fault, and commenting out crucial calls. This will identify just which call and what arguments are causing the segfault. I wish there was an easier way.

    I have checked, your code has no syntax errors.
    http://www.piliapp.com/php-syntax-check/

    I notice that many of your id fields and names have a leading digit (“2”), is this good practice ?

    Thread Starter Michael

    (@lilmike)

    Hi,
    I guess that’s the problem. It never actually gets to the next page. I enter my data, and then press save, it waits for a few seconds, then comes up with this program has stopped working message for apache. My only thoughts are the sanitization functions I defined are doing it, unless it’s something in wordpress itself.
    I’ll definitely see what I can figure out with your suggestions though.
    As for 2mb with 2 in front, I’m not sure if it’s good practice or not, I just did it because that’s the beginning of our website.
    Thanks,
    -Michael.

    You are crashing in one of:
    * WordPress functions
    * PHP functions
    * underlying mySQL functions
    I don’t see many other options.

    So progressively comment out various categories of function call. Take out more and more until it no longer crashes, then re-enable functions until it starts crashing again. You will end up with a minimal functional program which does not crash, one in which un-commenting any function causes it to crash again.

    Then the question can be re focused onto why.

    Thread Starter Michael

    (@lilmike)

    Hi,
    Thanks for your advice. I will go ahead and start doing this.
    -Michael.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘plugin saving options crashes apache with xampp’ is closed to new replies.