Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #12564 > unrolled thread

json testing suggestions

Started byBobMCT <r.mariotti@fdcx.net>
First post2014-01-07 20:33 -0500
Last post2014-01-09 13:38 +0100
Articles 13 — 9 participants

Back to article view | Back to comp.lang.php


Contents

  json testing suggestions BobMCT <r.mariotti@fdcx.net> - 2014-01-07 20:33 -0500
    Re: json testing suggestions Richard Damon <Richard@Damon-Family.org> - 2014-01-07 21:48 -0500
      Re: json testing suggestions BobMCT <r.mariotti@fdcx.net> - 2014-01-09 22:43 -0500
    Re: json testing suggestions John Smith <johnsmithjsm@live.com> - 2014-01-07 23:23 -0500
    Re: json testing suggestions John Smith <johnsmithjsm@live.com> - 2014-01-07 23:24 -0500
    Re: json testing suggestions jnorth.au@example.com - 2014-01-08 17:39 +1100
      Re: json testing suggestions "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> - 2014-01-08 12:32 +0000
        Re: json testing suggestions BobMCT <r.mariotti@fdcx.net> - 2014-01-08 08:18 -0500
      Re: json testing suggestions bill <william@TechServSys.com> - 2014-01-09 07:41 -0500
        Re: json testing suggestions John Smith <johnsmithjsm@live.com> - 2014-01-09 16:13 +0000
    Re: json testing suggestions Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-01-08 15:40 +0100
    Re: json testing suggestions Gregor Kofler <usenet@gregorkofler.com> - 2014-01-09 09:38 +0100
      Re: json testing suggestions Christoph Michael Becker <cmbecker69@arcor.de> - 2014-01-09 13:38 +0100

#12564 — json testing suggestions

FromBobMCT <r.mariotti@fdcx.net>
Date2014-01-07 20:33 -0500
Subjectjson testing suggestions
Message-ID<ddapc91qikj7gl9ar2a0n56r51ln4vg76o@4ax.com>
Pls help jolt my old memory with this?  Trying to work on some old php
progs that output using the json_encode function on a NEW install of
Ubuntu 13.10.  I'm NOT getting any output.  If I dump the array I'm
using as the source for the json_encode it looks just fine.  However,
firebug is showing non response.

I checked with phpinfo and it shows that I do have json installed and
active and when I try to run the target program I also receive just
errors.

So my question is:  can someone recommend some ways to properly debug
the ajax/json process?  I seem to remember firebug once having some
features available to examine the response from a js call but I don't
see it now.

BTW - having just recently upgraded from 10.04 to 13.10 I've run into
other issues with compatibiity.  Hopefully they are getting resolved
and this is just one of them.

Thanks for any advice/suggestions.

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

[toc] | [next] | [standalone]


#12565

FromRichard Damon <Richard@Damon-Family.org>
Date2014-01-07 21:48 -0500
Message-ID<a03zu.27775$PQ5.18770@en-nntp-06.dc1.easynews.com>
In reply to#12564
On 1/7/14, 8:33 PM, BobMCT wrote:
> Pls help jolt my old memory with this?  Trying to work on some old php
> progs that output using the json_encode function on a NEW install of
> Ubuntu 13.10.  I'm NOT getting any output.  If I dump the array I'm
> using as the source for the json_encode it looks just fine.  However,
> firebug is showing non response.
> 
> I checked with phpinfo and it shows that I do have json installed and
> active and when I try to run the target program I also receive just
> errors.
> 
> So my question is:  can someone recommend some ways to properly debug
> the ajax/json process?  I seem to remember firebug once having some
> features available to examine the response from a js call but I don't
> see it now.
> 
> BTW - having just recently upgraded from 10.04 to 13.10 I've run into
> other issues with compatibiity.  Hopefully they are getting resolved
> and this is just one of them.
> 
> Thanks for any advice/suggestions.
>

Have you checked the server logs to make sure the page being accessed
isn't generating a fatal PHP error and stopping the script?

[toc] | [prev] | [next] | [standalone]


#12576

FromBobMCT <r.mariotti@fdcx.net>
Date2014-01-09 22:43 -0500
Message-ID<k0ruc9l0qc0kn1p4i82ku38fu2lappjruo@4ax.com>
In reply to#12565
On Tue, 07 Jan 2014 21:48:35 -0500, Richard Damon
<Richard@Damon-Family.org> wrote:

>On 1/7/14, 8:33 PM, BobMCT wrote:
>> Pls help jolt my old memory with this?  Trying to work on some old php
>> progs that output using the json_encode function on a NEW install of
>> Ubuntu 13.10.  I'm NOT getting any output.  If I dump the array I'm
>> using as the source for the json_encode it looks just fine.  However,
>> firebug is showing non response.
>> 
>> I checked with phpinfo and it shows that I do have json installed and
>> active and when I try to run the target program I also receive just
>> errors.
>> 
>> So my question is:  can someone recommend some ways to properly debug
>> the ajax/json process?  I seem to remember firebug once having some
>> features available to examine the response from a js call but I don't
>> see it now.
>> 
>> BTW - having just recently upgraded from 10.04 to 13.10 I've run into
>> other issues with compatibiity.  Hopefully they are getting resolved
>> and this is just one of them.
>> 
>> Thanks for any advice/suggestions.
>>
>
>Have you checked the server logs to make sure the page being accessed
>isn't generating a fatal PHP error and stopping the script?

Thanks for all the responses/suggestions.  Being a newly installed
version of Ubuntu 13.10 Server I DID have to explicitly install the
php5-json package.  Guess what?  Now it works - gee.

And just one comment to "pointed ears" - get a life, huh!

[toc] | [prev] | [next] | [standalone]


#12566

FromJohn Smith <johnsmithjsm@live.com>
Date2014-01-07 23:23 -0500
Message-ID<ddkpc9h7kpjvl1uek0u0hteon9mnb143ss@4ax.com>
In reply to#12564
On Tue, 07 Jan 2014 20:33:21 -0500, BobMCT <r.mariotti@fdcx.net>
wrote:

>So my question is:  can someone recommend some ways to properly debug
>the ajax/json process?  I seem to remember firebug once having some
>Thanks for any advice/suggestions.
>
>---
>This email is free from viruses and malware because avast! Antivirus protection is active.
>http://www.avast.com

Hi, 

I still use json_encode like crazy, it works fantastic, no issues so
far; 

You need to test two places
- On the php, ensure that you actually get something rendered. Are you
sure the php array or object is valid ? That is simple to test, put a
breakpoint there and run in debug, you figure out fast

- On the browser side, I assume you use some javascript framework,
jQuery or something. If you don't, please do it, it saves headache and
time. It is possible that the json crashes when it gets evaluated,
although if it is generated with json_encode this is less likely to
happen: locate you callback function and place a breakpoint in the
javascript code and see what comes. 

Personally rather than leaving jQuery to eval my json, I prefer to
take the response as text and eval it myself - in between these two
likes of code, you can always alert(responsetext) and see what comes
back. 

That always worked for me...
--
John

[toc] | [prev] | [next] | [standalone]


#12567

FromJohn Smith <johnsmithjsm@live.com>
Date2014-01-07 23:24 -0500
Message-ID<4nkpc958dnmf0dmfouth8aog00osic8aps@4ax.com>
In reply to#12564
>Thanks for any advice/suggestions.
>
>---
>This email is free from viruses and malware because avast! Antivirus protection is active.
>http://www.avast.com


BTW, one thing - json_encode I don't believe that relies on an
external library, it was always there when I installed php;

--
John

[toc] | [prev] | [next] | [standalone]


#12568

Fromjnorth.au@example.com
Date2014-01-08 17:39 +1100
Message-ID<8bspc95gltpmkghp9nfa37l4u7n95dg11e@4ax.com>
In reply to#12564
On Tue, 07 Jan 2014 20:33:21 -0500, BobMCT <r.mariotti@fdcx.net> wrote:

>Pls help jolt my old memory with this?  Trying to work on some old php
>progs that output using the json_encode function on a NEW install of
>Ubuntu 13.10.  I'm NOT getting any output.  If I dump the array I'm
>using as the source for the json_encode it looks just fine.  However,
>firebug is showing non response.

In php you should have the code looking like:

$myVar = json_encode( $arr );
echo $myVar;
?>

In firebug:
place a breakpoint at the first line of code in the callback function.
The returning data is actually the error message from php and can not processed correctly.

>
>I checked with phpinfo and it shows that I do have json installed and
>active and when I try to run the target program I also receive just
>errors.
>
>So my question is:  can someone recommend some ways to properly debug
>the ajax/json process?  I seem to remember firebug once having some
>features available to examine the response from a js call but I don't
>see it now.
>
>BTW - having just recently upgraded from 10.04 to 13.10 I've run into
>other issues with compatibiity.  Hopefully they are getting resolved
>and this is just one of them.
>
>Thanks for any advice/suggestions.
>
>---
>This email is free from viruses and malware because avast! Antivirus protection is active.
>http://www.avast.com

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

[toc] | [prev] | [next] | [standalone]


#12569

From"Beauregard T. Shagnasty" <a.nony.mous@example.invalid>
Date2014-01-08 12:32 +0000
Message-ID<lajghl$2gk$1@dont-email.me>
In reply to#12568
jnorth.au wrote:

>>---
>>This email is free from viruses and malware because avast! Antivirus
>>protection is active.
>>http://www.avast.com
> 
> ---
> This email is free from viruses and malware because avast! Antivirus
> protection is active.
> http://www.avast.com

jnorth.au, you and BobMCT both need to reconfigure your Avast programs to 
remove the auto-insertion of the above spam messages. Thanks for your 
consideration. It's caused by your recently updated version, and it also 
has a malformed sig delimiter which causes it to be quoted by the unwary.

You do not need to scan outgoing or incoming email or news posts.
<http://thundercloud.net/infoave/tutorials/email-scanning/index.htm>

From the avastUI > Settings > Active Protection > Mail Shield > Settings
(wrench icon) > Behavior - General section > "Uncheck" Insert note into
clean message (outgoing).

-- 
   -bts
   -This space for rent, but the price is high

[toc] | [prev] | [next] | [standalone]


#12570

FromBobMCT <r.mariotti@fdcx.net>
Date2014-01-08 08:18 -0500
Message-ID<00kqc9llm5qec8m148fk1u46kr0polai02@4ax.com>
In reply to#12569
On Wed, 8 Jan 2014 12:32:53 +0000 (UTC), "Beauregard T. Shagnasty"
<a.nony.mous@example.invalid> wrote:

>jnorth.au wrote:
>
>You do not need to scan outgoing or incoming email or news posts.
><http://thundercloud.net/infoave/tutorials/email-scanning/index.htm>
>
>From the avastUI > Settings > Active Protection > Mail Shield > Settings
>(wrench icon) > Behavior - General section > "Uncheck" Insert note into
>clean message (outgoing).

Thanks jnorth.au - done!

[toc] | [prev] | [next] | [standalone]


#12574

Frombill <william@TechServSys.com>
Date2014-01-09 07:41 -0500
Message-ID<lam5e3$8sb$1@speranza.aioe.org>
In reply to#12568
On 1/8/2014 1:39 AM, jnorth.au@example.com wrote:

> ?>
>
> In firebug:
> place a breakpoint at the first line of code in the callback function.

OT: in firebug, how does one set a breakpoint ?

bill

[toc] | [prev] | [next] | [standalone]


#12575

FromJohn Smith <johnsmithjsm@live.com>
Date2014-01-09 16:13 +0000
Message-ID<2eitc950o3rhj46r9pfa6vo4v2k7t8lffq@4ax.com>
In reply to#12574
On Thu, 09 Jan 2014 07:41:36 -0500, bill <william@TechServSys.com>
wrote:

>On 1/8/2014 1:39 AM, jnorth.au@example.com wrote:
>
>> ?>
>>
>> In firebug:
>> place a breakpoint at the first line of code in the callback function.
>
>OT: in firebug, how does one set a breakpoint ?
>
>bill

you open the script in browser (start with right click - explore
element and from there go to the tab with the script, and set the
breakpoint. 

Chrome is better in terms of debugging than Firefox with Firebug. Try
it. 

For other questions please post in the right nntp group this is not
php


--

John

[toc] | [prev] | [next] | [standalone]


#12571

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2014-01-08 15:40 +0100
Message-ID<3549776.QtOaiXJ8Sx@PointedEars.de>
In reply to#12564
BobMCT wrote:

> Pls help jolt my old memory with this?  Trying to work on some old php
> progs that output using the json_encode function on a NEW install of
> Ubuntu 13.10.  I'm NOT getting any output.  If I dump the array I'm
> using as the source for the json_encode it looks just fine.  However,
> firebug is showing non response.

*Where* does it show “non response” (sic!)?  *How?*

If in the Network tab, there are two possibilities:

A) You are not making an HTTP request with the correct URI.
B) You are not sending a non-empty HTTP response.

If A), you have to check the client-side script and Firebug's error console.  
If B), you have to check the server-side script.  Make sure that there are 
no syntax errors or other PHP errors.  The first lines of your PHP program 
should be:

<?php
  error_reporting(E_ALL | E_STRICT);
  ini_set('display_errors', true);

ini_set() is necessary (except on a development system where the value 
should be the default) unless you want/have to check the PHP log files 
instead.

> I checked with phpinfo and it shows that I do have json installed and
> active and when I try to run the target program I also receive just
> errors.

*Which* errors?
 
> So my question is:  can someone recommend some ways to properly debug
> the ajax/json process?

In addition to the above, there is the FirePHP add-on.

> I seem to remember firebug once having some features available to examine
> the response from a js call but I don't see it now.

They still are in the Network tab and the Console.  <http://getfirebug.com/>

> BTW - having just recently upgraded from 10.04 to 13.10

Of what?

> I've run into other issues with compatibiity.

Useless information again.

<http://www.catb.org/~esr/faqs/smart-questions.html#beprecise>

And please get a real name.


PointedEars
-- 
Danny Goodman's books are out of date and teach practices that are
positively harmful for cross-browser scripting.
  -- Richard Cornford, cljs, <cife6q$253$1$8300dec7@news.demon.co.uk> (2004)

[toc] | [prev] | [next] | [standalone]


#12572

FromGregor Kofler <usenet@gregorkofler.com>
Date2014-01-09 09:38 +0100
Message-ID<laln6l$3q6$1@dont-email.me>
In reply to#12564
Am 08.01.2014 02:33, BobMCT meinte:
> Pls help jolt my old memory with this?  Trying to work on some old php
> progs that output using the json_encode function on a NEW install of
> Ubuntu 13.10.  I'm NOT getting any output.  If I dump the array I'm
> using as the source for the json_encode it looks just fine.  However,
> firebug is showing non response.

Perhaps this:


<http://askubuntu.com/questions/361424/what-happened-to-json-encode-in-13-10-php>

With PHP 5.5 on Ubuntu 13.10 php5-json has to be installed explicitly.

Gregor

[toc] | [prev] | [next] | [standalone]


#12573

FromChristoph Michael Becker <cmbecker69@arcor.de>
Date2014-01-09 13:38 +0100
Message-ID<52ce9858$0$9507$9b4e6d93@newsspool1.arcor-online.net>
In reply to#12572
Gregor Kofler wrote:

> Am 08.01.2014 02:33, BobMCT meinte:
>> Pls help jolt my old memory with this?  Trying to work on some old php
>> progs that output using the json_encode function on a NEW install of
>> Ubuntu 13.10.  I'm NOT getting any output.  If I dump the array I'm
>> using as the source for the json_encode it looks just fine.  However,
>> firebug is showing non response.
> 
> Perhaps this:
> 
> 
> <http://askubuntu.com/questions/361424/what-happened-to-json-encode-in-13-10-php>
> 
> 
> With PHP 5.5 on Ubuntu 13.10 php5-json has to be installed explicitly.

Good catch!  Regarding the explanation[1] that is linked from a comment:

| The response from PHP has been to remove the standard PHP JSON
| extension as of PHP 5.5rc2.

AFAIK, JSON has not been removed from PHP, but rather from some
distributions.

[1] <http://iteration99.com/2013/php-json-licensing-and-php-5-5/>

-- 
Christoph M. Becker

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web