From owner-freebsd-questions@freebsd.org Fri Feb 1 15:25:03 2019 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F244614B6DB2 for ; Fri, 1 Feb 2019 15:25:02 +0000 (UTC) (envelope-from markmoellering@psyberation.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 56F5B6CD89 for ; Fri, 1 Feb 2019 15:25:02 +0000 (UTC) (envelope-from markmoellering@psyberation.com) Received: by mailman.ysv.freebsd.org (Postfix) id 1AEA414B6DAF; Fri, 1 Feb 2019 15:25:02 +0000 (UTC) Delivered-To: questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA34A14B6DAD for ; Fri, 1 Feb 2019 15:25:01 +0000 (UTC) (envelope-from markmoellering@psyberation.com) Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C3886CD87 for ; Fri, 1 Feb 2019 15:25:01 +0000 (UTC) (envelope-from markmoellering@psyberation.com) Received: by mail-qt1-x82d.google.com with SMTP id l11so7941775qtp.0 for ; Fri, 01 Feb 2019 07:25:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=psyberation-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=saSHqkVd6g+XGRHctEoEeqiAGsbwf06nIHHaFh4RsMA=; b=JYDH55lGh9zcWByWVg3DsA4+Z+Mb7Sbzse7gTDOwewKcSX9TBkqO2+BJ0u6lJKcTw2 36kiJVvppT0nswdk1UoPgIaqYWEfX8sDuWkyk3OoGGVCIwcgwt8JwJgyzEQvhaHK/6we E0O5FwsjcxnuEfTHW1sBCpEAcMWtlqaHqdFncm5uDHElYgv8Z6ytFuKbh06xP7OwbQD3 +hFj/6E9qqo6JgagOcpb1Jwr9Aw8l5FbJPan6+0I2WMQ/q8p/OJcO63cuZKmLmzwRKEp 0kAo82SGphNQV5CnEEJA2PUDHuoXJY+yGCvaHrZphGsEJAd5KPuTSml3FdqzwIIsn1rt zRXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=saSHqkVd6g+XGRHctEoEeqiAGsbwf06nIHHaFh4RsMA=; b=GaO3ZvNKfLlwID25tNmVOiANYZnQV4uPGe8Z6CMCWAv42B9E12xsFe0x9OKSNdIhUW ekyaLakWZLVYhlDLZJeGNw66ozoPPjrkhP2Vr+0H50HXx0rmQ99hALiXWCZnaijmfd8T GdPXOSWZ2t4fA7mnIjlT3kNnHOa+5LyxzTAky5edqNW2JDf0Ie6xmGK18VwyRt9Vlo2W 3hudN8MtMTdYEnQYYy1CxBfL2B4ZeRrWOwWFtHa0fn2yMTDJ0/drzRzADrvoHHoMo9mS eI2C9gHuOqBcgUGFMQJTZyNra/wvTIEYVJOms5nHk/2Xggsii1pCI5jUPMldYSUG4mUe EdKA== X-Gm-Message-State: AJcUukd4BWKmACE0lY/LIg8M1AYAysGTR9HewtbYvKOn8QJ6iYiDlSWR ssESutdpVmjTFAyzoe1S4+5wQR8gdfYgM7eKWRG/A6HP X-Google-Smtp-Source: ALg8bN7aSFZjww210eGcDVgJFe8SUKBL+AEdUIajICcTFE+S/vMHrgQSEM2tKrqmiuNZEqICebIxzGa0GpKgUrCyHaw= X-Received: by 2002:aed:23c5:: with SMTP id k5mr39693549qtc.39.1549034700625; Fri, 01 Feb 2019 07:25:00 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Mark Moellering Date: Fri, 1 Feb 2019 10:24:49 -0500 Message-ID: Subject: Re: Problems with JSON and PHP To: questions@freebsd.org X-Rspamd-Queue-Id: 6C3886CD87 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.947,0] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 15:25:03 -0000 On Fri, Feb 1, 2019 at 10:17 AM wrote: > >> test# more /usr/local/www/apache24/data/test.php > >> >> print "Hello world"; > >> > >> $myObj =3D (object) array(); > >> $myObj->name =3D "John"; > >> $myObj->age =3D 30; > >> $myObj->city =3D "New York"; > >> > >> $myJSON =3D json_encode($myObj); > >> > >> echo $myJSON; > >> ?> > >> > >> > >> I use php and my biggest complaint is the way it handles errors. I > think > > what is happening is that your Object Definition has a syntax error but > php > > is complaining about the json_encode. > > I believe (from the php.net docs) that it should be > > > > $myObj =3D new stdClass(); > >> $myObj->name =3D "John"; > >> $myObj->age =3D 30; > >> $myObj->city =3D "New York"; > >> > > > > Don=E2=80=99t believe that=E2=80=99s actually the issue, since the suppli= ed test.php works > like charm for me, either in my browser (through apache) or via command > line. > > If it were the declaration, the command line would fail as well. > > Peter > There you go, injecting logic. The only other thing I can think of is check the FPM php.ini file. What happens if you try a simple json_encode of a string? Try the simplest call first, then go on from there.