473,386 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

debugging server service code

usually it is handy to debug PHP programs using print_r() or
var_dump(), as they can print out all the variables you need and the
web browser can show any run time error message. But what if it is
the situation when the php file is providing info to the Javascript
either as an AJAX call or even more so, as an OpenSocial's service --
in those case, there is a bunch of parameters provided to the PHP file
and it is really hard to mimic a session using
http://www.oursite.com/getData.php?a...ken=3424242345... with
possible data posted to the PHP file.

In those situation, we can write any variable to a file using
var_export() and a write function as a debug log... but what if there
is any run time error... is there a way to redirect all those info
also to a file, or somehow be able to see the run time error and stack
trace?

Any possible solution? Thanks for your help!

Jun 2 '08 #1
2 1075
li**************@gmail.com wrote:
usually it is handy to debug PHP programs using print_r() or
var_dump(), as they can print out all the variables you need and the
web browser can show any run time error message. But what if it is
the situation when the php file is providing info to the Javascript
either as an AJAX call or even more so, as an OpenSocial's service --
in those case, there is a bunch of parameters provided to the PHP file
and it is really hard to mimic a session using
http://www.oursite.com/getData.php?a...ken=3424242345... with
possible data posted to the PHP file.

In those situation, we can write any variable to a file using
var_export() and a write function as a debug log... but what if there
is any run time error... is there a way to redirect all those info
also to a file, or somehow be able to see the run time error and stack
trace?

Any possible solution? Thanks for your help!

You can set a log file in your php.ini file which will log php-detected
errors instead of displaying them.

I have it on on my development system, just so I can go back and look at
the errors if I need to. I just clean it up every few days (I make LOTS
of typing errors :-)= ).

It's also a good idea to have it on your production system and check it
on a regular basis to ensure there are no unexpected errors. I
generally have a cron job check the size and mail it to me of non-zero
on a daily basis, then rotate it with the rest of the log files.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jun 2 '08 #2
li**************@gmail.com wrote:
usually it is handy to debug PHP programs using print_r() or
var_dump(), as they can print out all the variables you need and the
web browser can show any run time error message. But what if it is
the situation when the php file is providing info to the Javascript
either as an AJAX call or even more so, as an OpenSocial's service --
in those case, there is a bunch of parameters provided to the PHP file
and it is really hard to mimic a session using
http://www.oursite.com/getData.php?a...ken=3424242345... with
possible data posted to the PHP file.

In those situation, we can write any variable to a file using
var_export() and a write function as a debug log... but what if there
is any run time error... is there a way to redirect all those info
also to a file, or somehow be able to see the run time error and stack
trace?

Any possible solution? Thanks for your help!
Further to Jerry's suggestions, you can also setup your own error handler
using
set_error_handler()
Jun 2 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Dmitri Shvetsov | last post by:
Hi All, Did somebody see the situation when the VS refuses to debug the Web Service at all? I can't catch why, the initially created Web Service can be debugged very easy but after some changes...
0
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
16
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the...
2
by: Craig | last post by:
Hope this is the right group, first timer - Just got back from holiday to find our Dev Server (Standard 2003, All hotfixes up to date) has been patched with KB 867460 (.NET Framework 1.1 Service...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
1
by: Robin Mark Tucker | last post by:
I have a problem with my web service - I can step into/through web methods, line by line, but the VS debugger absolutely will not step into a VB.NET method in a library the web service is using. ...
1
by: JLuis Estrada | last post by:
Hi there. Id tried to find information about how to set up the remote debugging on win2003. I have a PC with winxpsp2 with VS2003 installed. And I developed an winservice app that runs on the...
0
by: namrataa | last post by:
d:/IISerror.bmp I am working on C# WCF VS2008. I am writing service using WCF service library to be hosted in IIS5.1 and the host is written using WCF service web site. So that it can be hosted in...
4
by: =?Utf-8?B?TWlrZSBHYWxl?= | last post by:
VS 2008 initially didn't debug classic ASP. SP1 fixes this in some ways. You can debug if you select the debug option to "Start Without Debugging, then either attach the debugger manually or...
7
by: GaryDean | last post by:
(this was also posted on the MSDN WCF forum but the answers over there are not so good) I have a WCF Library hosted by IIS 6 and it all works fine. However I need to step through the code in the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.