473,287 Members | 1,946 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,287 software developers and data experts.

READ FIRST: Turn On PHP Debugging Messages

Motoma
3,237 Expert 2GB
Debugging messages are a powerful tool; however, many production systems (and test systems for that matter) have them disabled by default. If your PHP script is crashing horribly and you are not getting any runtime error messages, it is likely that this is the case for you.

You can initiate PHP debugging messages for the server by changing the display_errors and error_level settings in php.ini. Unfortunately, this is not the best situation in a production system. Luckily, you can enable error reporting on a page by page basis by simply adding the following lines to the top of your PHP script:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. error_reporting(E_ALL);
  3. ini_set('display_errors', true);
  4.  
  5. //  Rest of the PHP code
  6.  
Additionally, to assist with debugging MySQL errors in PHP scripts, you can tack on an additional die clause to your MySQL queries. The following lines will cause your script to halt when a MySQL query fails, and report the error message:

Expand|Select|Wrap|Line Numbers
  1. mysql_query($query, $link_id) or die('<hr />MySQL Error: ' .mysql_error(). '<hr />');
  2.  
If you script is not producing any error messages, please try these two methods before posting your question in the board. Remember, the community experts can only be as helpful as you are, and they can only work with what you give them.

Thank you for reading,
Motoma
Apr 7 '07 #1
0 35957

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

Similar topics

1
by: jenny | last post by:
Hi, I have a java socket program running on AIX 4.3.3.0 platform. It opens a socket and sends data to our customer over a leased fractional T1 line. The line is always connected. However,...
4
by: Matt | last post by:
For debugging javascript purposes, should we ensure the following check boxes (1-3) are checked. In IE browser, tools->Internet Options->Advanced Under Browsing, 1) disable script debugging...
3
by: gaugust | last post by:
I am running Visual Studio .Net 2003 with Windows XP Pro and SP2. I am tying to run an ASP .Net application in debug mode. In Web.Config file I have set debug="true" but I am getting an error:...
0
by: Joergen Bech | last post by:
Fairly new to ASP.NET 1.1. Getting the error below when running application on a web server outside of my control, but only the first time I run it: 1. After a long period of inactivity (or...
3
by: Scott Emick | last post by:
I want to be able to turn off these messages in my output window The thread '<bla>' (0xaa4) has exited with code 0 (0x0). When I'm debudding multi-threaded apps it can get annoying. --...
4
by: Josema | last post by:
Hi to all, Im searching a hand to solve an Exception that i get when i try to give the user to a gmail account... Any help would be appreciated.. Thanks in advance This is a piece of my...
6
by: Rob R. Ainscough | last post by:
I can't seem to locate the appropriate area in VS 2005 where I can accomplish this -- is this a C# only option? Thanks, Rob.
6
by: arnuld | last post by:
This works fine, I welcome any views/advices/coding-practices :) /* C++ Primer - 4/e * * Exercise 8.9 * STATEMENT: * write a program to store each line from a file into a *...
1
Markus
by: Markus | last post by:
Before you post please: Turn on PHP Debugging Messages - this will help yourself and our experts to solve your problem. Please provide the error details in your post. Read the Posting...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.