Does Anyone Know Any Good Debugging Techniques.
Does anyone know any good debugging techniques. Especially for mysql
queries, and global variables. My php IDE's (Glimmer, and Bluefish)
supposedly have debugging functions but I cant figure out how they work.
So any help would be excellent.
View Complete Forum Thread with Replies
Related Forum Messages:
OOP Techniques
I hava a question about OOP techniques. Up until now i have used objects as variables, mainly for encapsulation. For example, encapsulating database connections, sessions, templates, permissions etc into classes for easy code reuse. However, i'm finding much of my programming still very procedural. I've heard lots of talk rescently about "pure" OO. But how is "pure OO implemented? After having a look into the vanilla forum code, this seems to be a good example of "pure" OO code.
View Replies !
Development Techniques
It seems to me that a lot of PHP developers don't use a proper development method. A lot of the posters are either: - Developing applications on production servers OR - Developing on a platform radically different from their production server Neither of which is a good idea of course. Does anyone actually use a proper development system, or is it just me?
View Replies !
Techniques For Update Queries
I have a form that is used to update a table in which I want all items to be optional. I'm finding it difficult to write this query because I end up with updates on fields that may contain no data which will overwrite existing data. It's simple to accomplish when you have a static field to start the query out with PHP Code:
View Replies !
Page Rendering Techniques.
I've seen recently don't create the website in html and then implement bits of php. They render the site bit by bit by concatenating html onto a variable that is echo'd at the very end. Where can I seek advice on how to go about this? Or can you give me some ideas..
View Replies !
Page Access Restriction Techniques
I want to know how you can restrict access to certain PHP pages, based on the password used at login. One idea is to check against a privilege table everytime a page is loaded, but that will create a heavy database traffic. Any ideas?
View Replies !
Validating File Uploads - Various Techniques
From my reading there is some consensus that using $_FILES['userfile']['type'] to validate an uploaded file is a security risk. Other approaches include using getimagesize(), exif_mimetype(), and checking the last chars in the file extension (e.g. .jpg). Does anyone have an argument for or against these?
View Replies !
Large File Upload And Process Techniques
Well I've been trying to process a 25,000 record file and thanks to some help here have managed to do so. So then I worked on a 50,000 record file and this time it uploads, begins processing, then it hangs. The browser stays open, keeps acting like it's thinking but never comes back. It processed a bunch of rows but then hangs. If I try it different times, it will do the same, having processed a different number of rows each time, even though the code and the data are the same. The file is just over 5 meg. The parameters I changed to help make this all work include: PHP Code:
View Replies !
Updating Flat Files, Using Fopen, Fwrite, And Fclose Techniques.
Here is a function I wrote that will handle my password changes for me. There's the regular form of putting in your current password, and typing your new password in twice. This form will take the username, current password, and the two new passwords typed in and process the information. $admin is basically an administrative override if the administrator needs to change the password for a user. Code:
View Replies !
Debugging PHP
My boss and I are fairly new to PHP and would love to hear suggestions on how to debug PHP with ease and efficiency. Thank you for your time and consideration.
View Replies !
PHP Debugging
I have been programming in php for few years but have never used anything but free hosting to run php. My programming requirements have evolved and now I am in need of a debugger to understand how code is functioning (so I want to be able to step through the lines of code, watch variable values and object contents etc.)Code:
View Replies !
Debugging In Php
What is the best way to debug in php? What is the best way to see the value of your variables? I'm coming from the Flash MX world, and in there, you can do a trace() and it traces out the value of your variables to the message window. PHP has print and echo but that seems to mess up the page layouts too much. Is there a way to print variables to a log file?
View Replies !
Debugging PHP In OS X
if there are any other mac users out there who have managed to get a debugger up and running in OS X. Im not finding any decent tutorials that let you use a stand alone debugger (i.e. not integrated with zend studio or komodo). I generally use textmate for editing and would like to find something i can use along with that.
View Replies !
Debugging
how to set the error handling in the ini file to E_ALL, E_ERROR, E_WARNING etc. We had everything setup and working then we had to restart the server and it for some reason, reset the ini file back to the way it was. SO we went back to the ini file and set it back up but now it does not work. We even set it to just E_ALL. And nothing. We just get a white page. Code:
View Replies !
Help Debugging Query
I was wondering if anyone can help me here? The following code sends out an email alert to members of my site when a matching result is found....
View Replies !
Debugging Query
I can't for the life of me work out why I keep getting this error: ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE username='billybob')' at line 76 PHP Code:
View Replies !
Installation Debugging
1)I get startup error messages: "Unable to load dynamic library c:phpphp_curl.dll - the specified file cannot be found" although the file is very much there at exactly that location Not only for this file but for many extension files like php_mysql.dll, php_oracle.dll, php_mssql.dll, php_exif.dll etc. 2)the extensions_dir setting is "c:php" without an ending backslash. 3)The php.ini file is residing at c:php 4)The php.ini file in c:windows has all extensions disabled so it does not look as though that php.ini file is the source of the messages 5)There is a extension entry for php_win32api.dll which also gives a not found error. Is it the older version of php_win32std.dll, php_win32service.dll and php_win32scheduler.dll files which are present but their names are not there by default in the php.ini ? ************************************************** ************************************************ 6)How do I debug PHP like you can debug Java in Eclipse or NetBeans and C/C++ in MS Visual Studio - with breakpoints and stepping? ************************************************** ************************************************ 7)database access through odbc works. 8)How do I install PHP as both a CGI extension under Apache 2.0.5x and as a module (php5apache2.dll with a LoadModule in httpd.conf) - Apd which is a part of PEAR requires that php be installed as a CGI binary - is apd good for interactive debugging?
View Replies !
Debugging In Komodo
Does anyone use Komodo from activestate to write their PHP? If so, have you used the debugger? I'm new to debugging with an actual debugger (I'm kinda old school and have always relied on echo and print...). When I'm running it, the debugger stops at EVERY SINGLE line of PHP code... I'm debugging a pretty long script and it just takes WAY too long. Is there a way to tell the debugger to just execute the code up to a certain point?
View Replies !
XOOPS Debugging
I am working with this XOOPS CMS and started having problems. Everything was working fine all pages, modules displayed, then it just went blank. Now I tried doing some trouble shooting following the advice on their site about what to do if I am ending up with blank pages. The thing is I cannot even get to the admin login page to set the debugging options from there. Anyway I changed the debugging options via the database and still no errors are being displayed.. just the blank page. I look at the error logs form the server and went through each module folder and looked to see if there was any error logs. 2 of the error logs state that that there was an unexpected $ in one the XOOPS common.php file and it pointed out the line number. I have looked there and see nothing and I know that the error does have to occoured there it's just where the script halted. My question is that the error could have orignated from any module.. How can I get some errors to show on screen so i ca do a trace. I here it could be possible via .htaccess.
View Replies !
Debugging PHP4 With Dbg, Gdb, And Ddd
I want to create a debugging environment for PHP. I running Debian Woody and installed PHP4 from Debian's packaging system. I downloaded precompiled DBG from the webside and placed dbg.so in the same directory as mysql.so, Since MySQL works under PHP, I'm assuming I've got the right directory. I've updated php.ini per the DBG website. phpinfo() reports: 1. --disable-debug was part of the ./configure command. 2. ZEND_DEBUG=disabled, but the report does indicate that dbg is part of the Zend engine setup. 3. In the section on dbg, it reports dbg version 2.11.23, linked as a shared library; profiler compiled,enabled; debugger.enabled=on; etc. If I want to debug with dbg and gdb, do I have any options other than to recompile PHP omitting the "--disable-debug" switch? Once I do (or don't do) that, how does one hook gdb into dbg? How do most PHP developers who don't own a commercial IDE debug their programs?
View Replies !
PHP Error Debugging
I have been working with PHP for a while, but never gone through getting a good debugger - or debugging methodology. Can someone send me links to suggestions and possibly good (free) software? I am not hosting the website, so I cannot tell it to report all errors directly from the installation. I tried error_reporting(E_ALL ^ E_NOTICE); on top of the page, but that does nothing. So it always takes a while for me to fix the errors.
View Replies !
Debugging My Functions
I wrote this code to validate a few fields on a form which will be submitted when a customer wants a refill of their prescription medication. The first problem is none of the functions actually work properly. Both of the functions that validate names should throw an error if a name has less than 2 characters inputted in the field. Yet, it doesn't throw any errors if I insert only one letter in the field. The next function should verify a phone number. I can put a phone number with 6 numbers in it and it won't throw an error even though it is to short based on my regular expressions requirements which says it needs 7 to 14. The last function doesn't throw an error if I put <a href="bob"> in the comment box and it should throw an error if it finds a <a> tag. Code:
View Replies !
Debugging Error
I'm getting this error message after submitting a form in PHP: Fatal error: Call to undefined function sql_errno() in /home/jplane/ certcent/phpweb/phpnuke/html/admin/modules/quiz.php on line 542 It's suppose to write information to some sql tables. I'd like to further debug this message, maybe in mysql?
View Replies !
Installation, Debugging
(I am posting from a web interface- google groups, yet the message is not appearing on the group, so am posting again, if you get two of the same kindly ignore one) 1)I get startup error messages: "cannot load c:phpphp_curl.dll - the specified file cannot be found" although the file is very much there at exactly that location Not only for this file but for many extension files like php_mysql.dll, php_oracle.dll, php_mssql.dll, php_exif.dll etc. Code:
View Replies !
Debugging Charset
We've been building a pretty big web app here for internal use. SMS text messages come in from an aggregator and are stored in a MySQL 4 db. Our operators then deal with them using a web interface. The db is queried using PHP4 and the results output as XML which is then transformed using XSLT into XHTML. Now, in our testing environment everything works just fine. However, when we try and run it with actual live data, any incoming SMS message that contains a non-ASCII character breaks the system at the Sablotron stage (invalid token). Now the aggregating service is sending us the incoming messages UTF-8 encoded. The XML and XSL is all set up to be UTF-8. However, somewhere along the lines something is getting screwed up so that Sablotron barfs (typical examples are pound signs or euro signs). I'm having a hard time debugging this because as far as I can tell everything is set to be using UTF-8 by default. Clearly something isn't (MySQL possibly). I'd really appreciate some pointers for things to check.
View Replies !
Debugging Advice
syntax highlighting what methods or programs do people on here use to debug their php? I'm using linux so foss programs that run on both win and linux.
View Replies !
Debugging Rapidly
is there any program which shows all variable assignments during the running of a php script. im getting sick and tired of using echo $myvar to debug.
View Replies !
Debugging Scripts The Easy Way.
i found some ways to debug scripts like useing the error_reporting( E_ALL ); which will display any small bugs in your script and give you a warning about them. but the most common of them is ones like this: Warning: Use of undefined constant _jobdepartment - assumed '_jobdepartment' in c:foxservwww\_roguemodulesphprofessionadminindex.php on line 82 Warning: Use of undefined constant _joblisting - assumed '_joblisting' in c:foxservwww\_roguemodulesphprofessionadminindex.php on line 82 the line to fix is this: PHP Code:
View Replies !
Outputing Headers For Debugging
I am wondering if there is a way that I can output all of the information of which gets sent to a header within php? As I have got a problem where I can not set a cookie due to information being sent to the header and I have worked out where about in the script this is happening and have disabled all major coding (apart from when I am starting a new function) but I am still getting this problem. So I need to output all header information to see if I can work out what I am missing.
View Replies !
PHPEclipse And Remote Debugging
I'm trying to get remote debugging working with phpeclipse. I think i've installed everything correctly, and the debugger in eclipse starts, but breakpoints are ignored and nothing seems to happen :( Is there some way to simply check if the debug plugin for php is correctly installed (can I use dbglistener.exe to check if something happens when a php script is executed?) In the PHP Debug log i get a PHPLaunchingPlugin.InternalErrorOccured with the following stacktrace: java.net.SocketException: Software caused connection abort: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(Unknown Source) at java.net.SocketOutputStream.write(Unknown Source) at net.sourceforge.phpdt.internal.debug.core.PHPDBGPa cket.sendPacket(PHPDBGPacket.java:40) at net.sourceforge.phpdt.internal.debug.core.PHPDBGIn terface.continueExecution(PHPDBGInterface.java:184 ) at net.sourceforge.phpdt.internal.debug.core.PHPDBGPr oxy$PHPLoop.run(PHPDBGProxy.java:384) Is there something i can do to fix this? It could be that this is why it doesn't work. My files are all on the server, I open them from there with eclipse (so no local copy's). Webroot on server is c:/inetpub/wwwroot Share to this path on client is called Y: My debug configuration: environment > remote debug set to on working directory set to: Y:kernel_3site remote sourcepath set to c:/inetpub/wwwroot/kernel_3/site My setup: client (ip 192.168.1.200) eclipse 3.0.1 phpeclipse 1.1.3 DbgListener.exe (from dbg-2.11.32-cli-w32 package) is running server (ip 192.168.1.100) apache 1.3.29 (installed via nusphere tech platform 3.2) php 4.3.4 dbg v2.11.32 (shows in php_info(), so it should be installed correctly)
View Replies !
Debugging SOAP Web-Service In Php.
I am trying to debug a client/server combination using NUSOAP, but I am not able to find a way to do that! I have spent days playing with Zend, but I haven't found a way to debug it without a start page. How can I do this? (Know there are some other environments, but it takes a long time to figure them out, while keeping what I have). Also, is there some simple way to VIEW and ANALYZE what goes throug the http-port? Tried Ethereal, but it doesn't work locally with XP. Can use both IIS and Apache, PHP 4* and 5*
View Replies !
Formal Debugging, Why Do You Think It Doesn't Exist?
First of all, I feel that the debate between ASP and PHP is irrelevent, I think they are different enough that there is no comparrison or need for comparrison. However, what the article did bring up about debugging made me wonder why PHP doesn't have any. Why do you think the Zend Engine doesn't spit back more information for debugging? I have never really found a need for more debugging options in PHP, good old "echo" and trial and error work for me, but I can imagine that it would be nice for those who are new to the language etc... Besides, would it take that much more time to include some kind of decent debugging? Just wanted to see what the community had to say about it.
View Replies !
Debugging - Conditional Expression
I have a conditional expression that looks like this: if (($mtf->nntp_id || $mtf->mlist_id) && !$mtf->mlist_msg_id) { I want to get it to output the values of $mtf->nntp_id and $id variables.....
View Replies !
Debugging Column Logic
In a table displaying data on products in a given category I am trying to print table columns only if that column will be needed. However not all products in the category will have data for every cell, so for each product I want to display a table cell with data if it exists, otherwise display an empty cell. PHP Code:
View Replies !
Debugging DomDocument Objects
What is the best way to view the contents of a DomDocument Object? print_r() and var_dump() just give me empty objects. Here is my code, if you're curious: $dom = new DOMDocument(); $dom->loadHTML("<html><body><p>Hello World</p></body></html>"); print_r($dom);
View Replies !
Debugging Slow Sites?
In my new job I have inherited quite a large and complex (an in a few places badly written) PHP & MySQL website. It also handles a lot more traffic than I have been used to in my other jobs. The problem I have now is chasing down performance bottlenecks and slow queries, and other glitches that cause the site to hang, be unavailable or have weird load average / memory usage spikes on the webservers and the mysql servers I was wondering what other people use for sniffing out these problems, I was thinking about Zend platform, but that is looking like it might be too expensive (we are mostly advertisement funded, so margins are low despite high traffic).
View Replies !
Debugging / Logging Library
I could use some direction / suggestions on where to begin a debug / logging library. Basically instead of mysql_query($sql) or die('query failed '.mysql_error()); and anywhere else where mistakes can happen I want that event logged (in detail) to disk return 0 to the calling function and let the application deal with what it wants to tell the user / how to crash. Specifically any articles, tutorials or libraries that already do this type of thing.
View Replies !
Debugging - See A List Of All My Variables (without Specifying Them All By Name).
I have windows. I do all my coding on my local PC. I upload my files using FTP onto my Linux host. From there, I call my page and see if it worked, what changes to make, etc. I make changes on my PC, upload them again, etc. Right now, I would just like to see a list of all my variables (without specifying them all by name). How can I do that? I don't understand how the debuggers work and I'd be willing to learn, but it seems as though they have to be installed on the host. Code:
View Replies !
Need Third-party Debugging Tools
PHP has some pretty funky error messages: "parse error, unexpected T_IF"; "Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING"; Humans often see these - shouldn't they be more human readable and why are there no stack backtraces? When a problem arises, I am often interested in knowing where the problem code was called from. It seems as though - with PHP - I need third-party debugging tools.
View Replies !
Class With Some Debugging Functions
I'm writing a class with some debugging functions, but it doesn't work. This is a simplified version, but the error is still showing up: Fatal error: Using $this when not in object context in * on line 20 <? class A { var $debug = array(); function setDebug ($var) { $this->debug[microtime()] = $var; } function getDebug () { return $this->debug; }.
View Replies !
Debugging This Spell Checker
I know I can do more with it, but that's all I want right now. For some reason it thinks every word is misspelled. Eventually I'll want to highlight mispelled words and next to the word have a drop down box with all the possibilites in it. PHP Code: class spell_checker {         var $personal_path = "/speller/";         var $skip_len      = 3;         var $mode = PSPELL_NORMAL;         var $pspell_handle;         var $pspell_cfg_handle;         var $personal = false; ...
View Replies !
Debugging Php Mail - On Fedora, Using Php5
On Fedora, using php5. The mail() function returns a success - but the mail itself is not actually sent. How do I go about debugging this? Do I need to do this at the linux command level to ensure mail is working? any logs i need to look at?...
View Replies !
Debugging - Wrong Parameter Count
I've got somehow a little peculiar problem and can't seem to find the right solution so I could use a hand/hint or two. On toppings.php I have - among others: <a href="toppingremove.php?product=$productId&top=".$top1."">$top1</a> which on toppingremove.php gives me, i.e.: http://development.traders.dk/area5...%20alm.%20pizza In toppingsremove.php I have - among others: $price_topping = mysql_result(mysql_query("SELECT pricesmall ". "FROM esperia ". "WHERE top1 = '$topping'")); Prior to retrieving $price_topping I retrieve another single value with almost the exact same syntax and that doesn't give me any problem. Attempting to retrieve the value $price_topping unfortunately ends up in: "Warning: Wrong parameter count for mysql_result() in toppingremove.php on line 78" Where line 78 exactly and solely contains: "WHERE top1 = '$topping'")); This problem occurs only when the string passed over as top either contains danish special characters or a longer string with spaces and those special danish characters. I haven't encountered this problem with ASCII based strings. However, I have a page toppingsadd.php that performs the similar procedure just reversed and doesn't encounter this peculiar problem. The main difference is that for toppingadd.php I use urlencode($top) as top while toppingremove.php just passes the string itself as is. I have attempted to use urlencode for toppingremove.php as well to see if that would solve the problem however, it didn't make any difference. I've been around php.net to see if I could locate some hints as to what caused this and what could solve it,
View Replies !
Debugging An Authenticated Mail Function
My email server requires authentication, so I wrote (stole) some code that used the fsockopen()/fputs() functions to open a connection and write what I need manually to the smtp server. It worked fine for months, but we changed our network a bit and now the mail function I wrote works on one machine, but not on the webserver. I added in some error checking, but they return nothing. I would be grateful if someone could let me know the best/easiest way to debug this code and find out why I'm not sending email anymore: PHP Code:
View Replies !
Warning! PHP Is Not Configured For Debugging - In Komodo
I am looking for some assistance in 'fine-tuning' my preferences as I set-up my system to learn PHP. I am running Komodo professional, version 3.5.3, build 262321, platform win32-x86. Under Preferences/Language/PHP in debugger configuration, I am getting the following error message: WARNING! PHP is not configured for debugging. You can use the configuration wizard to configure PHP for debugging. When I try and run the Debugger Config Wizard I get to the point where it asks me to choose the PHP extension directory. I currently have e:/Program Files/perl/php/ext but when I try and click Next>, nothing happens. It will not accept this choice. What is it looking for? How should I be configuring the system for PHP Debugger support?
View Replies !
Debugging User Define Functions
when i was coding my own functions, it comes a time that i don't know if what part of my code was the bug, pls tell me how to best debug my own functions, if it is returning the right value or not.
View Replies !
Remote Debugging With Quanta+ On Linux
I am trying to remotely debug a PHP application. I have the following setup: - Web server A (application accessed via https, PHP with XDebug extension installed) - Development server B (location of the php scripts) - Remote workstation C (with Quanta+) After a lot of searching for infos and trial and error I have not been able to configure my environment on workstation C so I can remotely debug PHP scripts executed on server B. Does anybody use a similar configuration and know how to configure Quanta+? What other options for remote debugging do I have?
View Replies !
|