Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97169 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89324 invoked from network); 25 Nov 2016 07:17:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Nov 2016 07:17:36 -0000 Authentication-Results: pb1.pair.com smtp.mail=kalle.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kalle.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.196 as permitted sender) X-PHP-List-Original-Sender: kalle.php@gmail.com X-Host-Fingerprint: 209.85.223.196 mail-io0-f196.google.com Received: from [209.85.223.196] ([209.85.223.196:35761] helo=mail-io0-f196.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E5/5E-21589-D85E7385 for ; Fri, 25 Nov 2016 02:17:33 -0500 Received: by mail-io0-f196.google.com with SMTP id h133so8079631ioe.2 for ; Thu, 24 Nov 2016 23:17:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=EUNLv7gNXP5mOH1zcV99nwxAM44MjiGMzFgIARSsTOA=; b=E/uXYbhYk4KqxqkpVcxFajHQ6XlM7lNbcYXCuCeXUa/F6Di04pkQsI51gYbPatrJzg QrJw778B7k6e7DniRdmDUjyy7sQpuFfXBe31ILtOL9I0r4U4jjJhjo3C4JByqRZTQiN7 OkrVKHL/QbDM7oWYm2lpcIBSZDbKERzXNuIs+iGjspqDLjRhzlyeUH+UpIH4TP7Ut4Hb cdXW8afSy2vgh8jkU7Z/57uEKRVD7fjAM4MOtO5dv0bYGE68UwpY+0eyg36WemHoMdxe wa15RiV9ue2OKKm8S2cD2d+byC+hbG+kGLSZ9vC2AtVALfrAMQj0lZWqXKhofWw9PClV 2nEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=EUNLv7gNXP5mOH1zcV99nwxAM44MjiGMzFgIARSsTOA=; b=XlbYo0YKdtPTAap3MjluZIfmyA7viClc9M9RYit0tncCboqUDvESmGOzESIJ7jU/PI qFByM1nC/mzC8yP4WYZfrI8XFLNGLskq2dRL5fCHx/y4MbKtwv6TkAtp+sZLPxvrHHG9 fqa2MZ8oI7rRikn5AFMh/Vl5PovCf376jUyQHB9VjngxFmo6itYJw/UbqA2Mi6dzokRH FRStZXRVs02GCWfJ9mXKZCAanRUEQE7BQjoR6oagI8aWHGOKn39HZH8RAptxUG26ggC2 ixKBw9CE207CJdytjpFvpBLwZKK0BN2EBYMEr2gQ6R6zE8DyKi7GS6gOzRTVa649uy50 PIOw== X-Gm-Message-State: AKaTC03sJIknwneWoQrFiTONcvhyOrdiYNFec/F8iQnZg54RHbHDNOjeO1cPCJ1jUXq64XBfcH6tc+AM/wkpww== X-Received: by 10.36.208.82 with SMTP id m79mr5437286itg.1.1480058251088; Thu, 24 Nov 2016 23:17:31 -0800 (PST) MIME-Version: 1.0 Sender: kalle.php@gmail.com Received: by 10.107.138.234 with HTTP; Thu, 24 Nov 2016 23:17:30 -0800 (PST) In-Reply-To: References: Date: Fri, 25 Nov 2016 08:17:30 +0100 X-Google-Sender-Auth: mvG9qSwCAzZ4e0fattony2rOxLM Message-ID: To: Zheng Shao Cc: Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] How to handle error in sapi From: kalle@php.net (Kalle Sommer Nielsen) Hi Zheng 2016-11-25 6:40 GMT+01:00 Zheng Shao : > I'm confused by how to handle an error inside php_apache_sapi_read_post, shoud I throw a zend_throw_exception or use a global flag for error handling? php_apache_sapi_read_post() is invoked very early on (php_module_startup > sapi_activate > sapi_read_post_data), and therefore we are too early at initialization that you cannot really throw an exception to the user. What you can do however is to call php_apache_sapi_log_message() and try to log the error in the Apache error log instead, which seems more reasonable to me. -- regards, Kalle Sommer Nielsen kalle@php.net