PHP5 Stability issues?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daniel Andersen

    PHP5 Stability issues?

    Hey,

    We are in the process of rewriting our internal management system (which was
    written in PHP4), and figured this would be a good time to migrate to PHP5
    to get all the OO goodness it has to offer :) I am running php 5.0.3 on
    apache 1.3.something under slackware linux.

    Unfortunately I frequently get segfaults from php scripts, and they are not
    even scripts that do anything fancy or special. For example, in one script
    i got a segfault just in the middle of a HTML comment, which seems to make
    no sense whatsoever (unless hte crash came later and it hadn't gotten round
    to sending the rest of the output yet.. but whatever the case if i removed
    the html comment the code started working again). Another crash occurs when
    i assign a value to a variable, not any kind of special variable, just
    assigning a string value to a variable, and php5 segfaults.

    Naturally this makes very very unhappy as I very much want to move the new
    system to php5, because it looks like a much better language otherwise :)
    Has anyone else experienced problems like this? And more importantly, does
    anyone know how to get around these problems?

    Thanks,
    Daniel
  • NSpam

    #2
    Re: PHP5 Stability issues?

    Daniel Andersen wrote:[color=blue]
    > Hey,
    >
    > We are in the process of rewriting our internal management system (which was
    > written in PHP4), and figured this would be a good time to migrate to PHP5
    > to get all the OO goodness it has to offer :) I am running php 5.0.3 on
    > apache 1.3.something under slackware linux.
    >
    > Unfortunately I frequently get segfaults from php scripts, and they are not
    > even scripts that do anything fancy or special. For example, in one script
    > i got a segfault just in the middle of a HTML comment, which seems to make
    > no sense whatsoever (unless hte crash came later and it hadn't gotten round
    > to sending the rest of the output yet.. but whatever the case if i removed
    > the html comment the code started working again). Another crash occurs when
    > i assign a value to a variable, not any kind of special variable, just
    > assigning a string value to a variable, and php5 segfaults.
    >
    > Naturally this makes very very unhappy as I very much want to move the new
    > system to php5, because it looks like a much better language otherwise :)
    > Has anyone else experienced problems like this? And more importantly, does
    > anyone know how to get around these problems?
    >
    > Thanks,
    > Daniel[/color]
    Well for what its worth I've been through the same grief. The new object
    functionality in 5 is great, but i've ended up going back to 4 sources.
    I don't think its an intrinsic problem with 5, rather the underlying
    libraries and O/s that PHP piggybacks onto.

    Most of the problems appear to be related to non thread safe libraries,
    which is not a PHP issue. If one doesn't use an O/s that uses threads
    then 5 doesn't have a problem. PHP 5 + threaded O/s = a potential
    problem. Like all thread problems they are a real pain to diagnose.

    Rumour has it that setting up Apache to use mpm modules thus avoiding
    threading issues fixes any problems. Essentially, PHP of any description
    ain't thread safe.

    Chris

    Comment

    • Joshua Beall

      #3
      Re: PHP5 Stability issues?

      What software stack are you using? I have been running PHP5 on a Linux 2.4
      kernel, and Apache for the webserver for several months in a production
      environment. No problems, and I have some pretty "demanding" (i.e., non
      trivial code dealing with very large objects, DOM, 3+ levels of inheritance,
      and some *very* large strings variables) code. Never had a single problem
      that wasn't my fault (e.g., did something dumb and ate too much system
      memory with a script, etc.)


      Comment

      • NSpam

        #4
        Re: PHP5 Stability issues?

        Joshua Beall wrote:[color=blue]
        > What software stack are you using? I have been running PHP5 on a Linux 2.4
        > kernel, and Apache for the webserver for several months in a production
        > environment. No problems, and I have some pretty "demanding" (i.e., non
        > trivial code dealing with very large objects, DOM, 3+ levels of inheritance,
        > and some *very* large strings variables) code. Never had a single problem
        > that wasn't my fault (e.g., did something dumb and ate too much system
        > memory with a script, etc.)
        >
        >[/color]
        IMHO it appears to be a threading problem. Its the libraries that PHP
        employs that creaet the problem. For sure, thread problems only occur
        under load conditions, thats why they are such a pain to diagnoze. Lise
        of strings isn't an issue unless one is concerned with stack overflows
        which is more of a sloppy coding issue

        Comment

        • Daniel Andersen

          #5
          Re: PHP5 Stability issues?

          NSpam wrote:
          [color=blue]
          > Joshua Beall wrote:[color=green]
          >> What software stack are you using? I have been running PHP5 on a Linux
          >> 2.4 kernel, and Apache for the webserver for several months in a
          >> production
          >> environment. No problems, and I have some pretty "demanding" (i.e., non
          >> trivial code dealing with very large objects, DOM, 3+ levels of
          >> inheritance,
          >> and some *very* large strings variables) code. Never had a single
          >> problem that wasn't my fault (e.g., did something dumb and ate too much
          >> system memory with a script, etc.)
          >>
          >>[/color]
          > IMHO it appears to be a threading problem. Its the libraries that PHP
          > employs that creaet the problem. For sure, thread problems only occur
          > under load conditions, thats why they are such a pain to diagnoze. Lise
          > of strings isn't an issue unless one is concerned with stack overflows
          > which is more of a sloppy coding issue[/color]

          I'll respond to both posts at once here to save a bit of time :)

          I'm running Linux 2.4.26, which we run on other servers and appears as
          stable as can be hoped for. Apache is version 1.3.33 (which i believe is
          unthreaded, i was under the impression apache didn't start threading until
          the 2.x release series, but correct me if i'm wrong :)

          There is basically no load at all on the server, as this is just our test
          machine as we rewrite the system in PHP5, so the only person loading pages
          off the machine is me, and it does nothing else. The pages are complicated
          to the extent there is a lot of OO and custom error handlers set,
          auto-prepend and appends etc etc, but I wouldn't think they'd actually
          cause any kind of load.

          PHP's configure line is as follows, in case that helps at all:
          './configure' '--with-mysql' '--with-apxs=/usr/local/apache/bin/apxs'
          '--prefix=/usr/local/php/norm' '--enable-track-vars'
          '--with-config-file-path=/usr/local/php/norm' '--enable-magic-quotes'
          '--enable-ftp' '--enable-calander' '--with-zlib' '--with-gd'
          '--with-png-dir--with-jpeg-dir' '--with-curl'

          Thanks,
          Daniel Andersen

          Comment

          Working...