From owner-freebsd-questions@FreeBSD.ORG Wed Oct 8 19:50:54 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8336B106568A for ; Wed, 8 Oct 2008 19:50:54 +0000 (UTC) (envelope-from fcondo@quinn.com) Received: from sushi.quinn.com (sushi.quinn.com [216.27.181.95]) by mx1.freebsd.org (Postfix) with ESMTP id 544168FC14 for ; Wed, 8 Oct 2008 19:50:54 +0000 (UTC) (envelope-from fcondo@quinn.com) Received: from earth-pea.quinn.com (sashimi.quinn.com [216.27.181.11]) (authenticated bits=0) by sushi.quinn.com (8.14.2/8.14.2) with ESMTP id m98Jorp9033025 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 8 Oct 2008 12:50:53 -0700 (PDT) (envelope-from fcondo@quinn.com) Message-Id: From: Fred Condo To: nightrecon@verizon.net In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Date: Wed, 8 Oct 2008 12:50:53 -0700 References: <48ECACB4.8080103@shopzeus.com> <20081008131248.GA77388@icarus.home.lan> X-Mailer: Apple Mail (2.929.2) Cc: freebsd-questions@freebsd.org Subject: Re: php5 segfault X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Oct 2008 19:50:54 -0000 On Oct 8, 2008, at 10:53 AM, Michael Powell wrote: > Jeremy Chadwick wrote: > >> On Wed, Oct 08, 2008 at 02:51:00PM +0200, Laszlo Nagy wrote: > [snip] >>> >>> So it is using -O2 and -pipe. Is this something that I can disable? >> >> If you want. "make config" in /usr/ports/lang/php5 will give you a >> menu option for DEBUG; turn it on. >> >> I'm not sure what the compile options you're showing have >> *anything* to >> do with the segfault you're reporting. I don't see any backtraces or >> details of the segfault. > > I've used -pipe -O2 for years and never had it cause me trouble. > >>> It might be because we are using postgresql connections. For pages >>> without pgsql connection, there is no segfault. > > Still using MySQL so I can't speak to PostgreSQL PHP connectivity. > >> I've personally used PHP5 (as a CGI only, not as an Apache module) >> with PostgreSQL and experienced no segfaults. >> >>> It must be noted that the segfault happens on cleanup. E.g. all web >>> sites are working fine, except that we are getting many many >>> segfault >>> messages in the logs all the time. > > This will inhibit performance. The ones that are failing are having > the > script(s) restarted. If you can fix this performance will improve. > >> Many people have found that re-ordering the "extensions" lines in >> /usr/local/etc/php/extensions.ini has solved odd segfaults. I >> personally have never seen this, nor have ever needed to adjust that >> file, but it has worked for others. > > One quickie shortcut to try as experimentation is to just comment out > hash.so in extensions.ini. I have had trouble with this one, ie to the > extent Apache wouldn't even start. > > I've read/heard about the reorder thing too and never needed it. > What I > suspect is there is a possibility that what happened is people went in > after the fact and installed xyz extensions after the first main > install > after discoverring they forgot or left out something they needed. This > results in the line(s) just getting tacked on at the bottom. If they > had > wiped all PHP and done it again from scratch the list in > extensions.ini > would then be correct. Only a theory on my part. > >> Also, you cannot use a threaded Apache (e.g. threaded MPMs) with PHP >> since not all extensions support threading. Your Apache needs to be >> built without threads and use a non-thread model (e.g. prefork). >> I've >> also had success with Apache-ITK-mpm. > > This is very true for mod_php, but less so if PHP is run as FastCGI. > I am > currently running a box at work with the event mpm and mod_fcgid for > testing and it seems to be doing well. YMMV > >> Search the mailing lists for this situation, try the recommendations, >> and then if nothing fixes it, provide a backtrace. >> > > The normal default of error_reporting = E_ALL & ~E_NOTICE is > present, but if > you want it to log to it's own file uncomment ;error_log = filename > (or > syslog if you prefer). You may need to do a 'touch on the > and > make it's permissions match those the webserver runs under. > > If things get really bad take a look at http://www.xdebug.org/ > I don't think this really belongs on a production machine (IMHO), > but I have > used it on my development server. Better as a last ditch effort > probably. > > -Mike Have a look at http://www.pingle.org/2007/09/22/php-crashes-extensions-workaround PHP extensions have to be loaded in a particular order to avoid the segfaults at cleanup.