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 Complete Forum Thread with Replies
Related Forum Messages:
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 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 !
CMS Advice
Apologies for x-posting but seemed no obvious single forum for my query. I am new to content management systems and am considering using a cms to implement a content-based web site with a view to applying a unified appearance across content, and to be able to easily add & organize new content. My ISP offers joomla, mambo, postnuke & xoops so no worries about installation. My main criteria (in rough priority order) are: Ease of use Flexibility & ability to customize Range of features Size of userbase
View Replies !
XML Advice
Just after a bit of advice, I was looking to create a a shopping cart type thing that runs from xml files rather than a database. I've looked at some of the xml parse functions so I can obviously read the data from the file. Will it be possible to do things like product searching? how efficient will it be compared to using MYSQL.
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 !
Maths Advice
I am learning PHP. I see in my training that "a good threshold for comparison of currency amounts is ".00001" (due to the way computers store numbers internally). I know of internal storage forms even from the old days when I programmed assembler on IBM 360/370. But I've also seen this threshold given for javascript etc. I have yet to understand why 5 digits are compared for eventual 2-digit rounding... Anyone with easily understood advice? (I don't need code, just reason)
View Replies !
Advice On Running PHP As A DSO, CGI, Or Both...
I am currently running Apache 1.3.27 under darwin (Mac OSX 10.2.6 BSD kernal), with PHP 4.30 as a DSO module. I recently discovered I need to run some PHP scripts outside of the Web server as batch jobs by utilizing CRON since their execution time would typically time-out a Web session. My question is three part: 1) Is there any difference in PHP running as a DSO vs. a CGI under Apache? Meaning, is there any difference in performance, features, access to databases, etc. 2) Should I run PHP as a CGI instead of DSO? Would this allow me to run my scripts under Apache without modification AND allow me to run PHP as a stand-alone language for command-line and CRON scheduled execution, etc. 3) If there is a performance difference with PHP as a DSO versus CGI can both be run on the same machine without conflict?
View Replies !
Security Advice On My Cms
I am using the following code to make module system cms. Code: //index.php require_once("mainfile.php"); global $site_path; if (!isset($_GET["file"])) { $file="index"; } else { $file=$_GET["file"];} if (!isset($_GET["mod"])) { $mod="home"; } else { $mod=$_GET["mod"]; } if(ereg("..",$mod) || ereg("..",$file)) { echo "Bad boy"; exit(); } $file ="$site_path/modules/$mod/$file.php"; if (file_exists("$file")) { include($file); } else { die("sorry, File does not exist");} You can see that I am using this concept http://www.mysite.com/ index.php?mod=$modulename&file=$modulefilename I just want to know is there any security hole in the code.How to stop direct access to a file withouth my main index.php file ?let say i have module call"member" and inside i have index.php,myprofile.php etc... and I want to stop direct access to these file(ie.http://www.mysite.com/member/index.php) onlyway, http://www.mysite.com/index.php?mod=member&file=index is allowed in this case.
View Replies !
Forum Advice
i'm writing a forum in php and i have a few logical questions which i would value your advice on. when you delete a post that has more than one child what is normally done with the orphaned posts?
View Replies !
Artist Needs Advice.
I am an artist working out of Los Angeles, and I have a project I've been working on which may need MySQL and or PHP. I put an advert in the local paper asking readers to leave a message on a vonage voicemail number. I've received about 60 messages so far. People have left some pretty interesting stuff without knowing what the purpose was. What I want to do now is create a web site so that I can make the original messages plus new messages available to people as well. I would need some kind of program which polls a POP3 email account for new messages, and then parses the WAV audio files out of the email and places them on the web site. I have a good friend who is a web designer, who can handle the front end, but he doesn't know anything about database programming - he told me to check in with you guys. My current web host uses Apache Web Server, Apache SSL Server, MySQL, qMail POP Server, qMail SMTP server. Does anyone have any suggestions as to what I might need to do/ use to get this idea off the ground?
View Replies !
Advice For A Re-tread
I have been writing Cold Fusion code for a number of years using both SQL Server and Access. Cold Fusion used to be pretty good when it was owned by Allaire. In my opinion, a downhill slide started when MacroMedia took it over. Now that Adobe has it, I have visions of my web pages taking as long to load as Adobe and with just as much overhead. Therefore I have a sense that I should seriously look at PHP. Can anyone advise a good source (web site or book) that would help me make the transition.
View Replies !
PHP Recruitment Advice
First of all apologies if this is off topic - it's less PHP language than administration.... I'm trying to recruit a PHP/MySQL programmer for our UK (London) based financial training company. The job involves working on a large database application that comprises and spans multiple functions, including content management, report generation, accounting functions, CRM systems as well as a host of much smaller functions. My questions are two fold. 1. Does anyone know of a good recruitment agency or method for obtaining decent candidates. So far most of the applicants I've seen have rather poor PHP skills, or (more commonly) MySQL abilities that are really not up to scratch. So, any advice from anyone who has tried to recruit for such a position would be well received! 2. With some trepedation, any interest here in such a job? Salary is circa. £23,000. We have very high standards and please only apply if you would describe yourself as particularly competent. A typical interview question I've been asking (and most people failing) is to describe what the 'explain' mysql keyword does and how it's used. I'm less interested in commercial experience than I am a solid knowledge of PHP/MySQL and the ability to hit the ground running with technical problems. On the plus side, this is a great company to work for, with a very fast paced style - guarantee you'll never be bored!
View Replies !
CMS/Portal API Advice
I need advance considering CMS/Portal. Features welcomed: - not a final product, in the first place, but API - ability to shape it into different CMS solutions - ability to work with PHP/Postgres/MySQL hosting server - API for simple content editing, template editing, for user management, user authorization - BSD-like or GPL-like license, I am redy to contribute back Is there anything out there that comes close to this ?
View Replies !
Inheritance Advice
I'm still relatively new to the whole OOP concept, so go easy. My problem is that I want to inherit functions from 2 parent classes. I want to alter/extend the functions from the first class and just use the functions from the second class. So, I figured that I would use 'extends' from the first class, but then how do I get the functions from the other class? Would I use require_once('secondClass'); and then create a new instance of that class inside the child class? Is there a sensible way of doing this, or is it time to go back to the drawing board and re-organize stuff?
View Replies !
Need Security Advice.
Script checks to see if there's an Administrator account, if not.. prompted to create one via forms/php (mysql insert). The only problem with this, is if the user of the blogger doesn't Lock his admin directory, then it would be simple for some one who knows the script to run the creation file. I've pondered either locking/unlocking the Username and Password feilds, so no more data can be inserted. Or using UnLink to delete the creation file. Obviously, if something happens and admin tables are deleted or destoyed, and the user won't be able to create a new user, untill he uploads create.php again.
View Replies !
Code Advice???
I coding a dynamic menu that has 1 sub menu, and will never have any more. The way I'm coding it at the moment is very messy any I was wondering if anyone could suggest a better way.I want to store the menu items and their urls in an array, but I dont really know where to start.The menu for example will look like this... Home Item 1 Item 2 About Cheese Item 1 Item 2 At the moment I'm storing the top items like this: $top_menu = "Home.index.php, About Cheese.cheese.php"; Then doing 2 splits to get the required items... As you can see its a bit of a mess. If i were to continue this way the the sum menu's would be really bad.
View Replies !
Some Advice On Define()
Is there any advantage to using define() instead of just setting a variable? I've not really used define before, but was just wondering what difference it made: <?php // What's the difference between this: define('MY_VARIABLE', 'my value'); // and this: $myvariable = 'my value'; ?>
View Replies !
Need Expert Advice Regarding
Im am putting together a small program for a client, part fo this program needs to be able to create steps/order of a job. Basically, I need to be able to "add another step" so lets say i have a table with the following fields that need to be filled and stored in the database: Code:
View Replies !
Subfolder Advice
As part of the "learning experience"; I realize that my current setup is probably not ideal. I have been storing members' images in a folder called "pics" and I point to them in mysql. Right now they all are in the same folder and there are over a few thousand of them. At this point I can't even browse to all of the files using FTP because it must be beyond some limit. I'm hoping to hear some advice on a few things here: How many files is "too many" to have in a directory? Currently when a member creates a profile their image is named as their memberid#; such as 1234.jpg. If I go with subfolders, how will I seperate? Per thousand? Per 100? Assuming it's per 100; how would I design the script so that when the 400th member creates a profile it builds a new folder and names it 400 or whatever? Code:
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 !
|