Debugging PHP/Zend Framework web apps - php

i am using Zend Framework. some techniques i use currently
Zend_Debug::dump() (+die())
Zend_Log: to firebug/firephp
i particularly like the log to firebug, but when logging large objects, eg. doctrine 2 models (with many associated objects etc), i find that it slows down and crashes alot.
what alternatives are out there?
i currently use Notepad++, used Aptana Studio 3 b4, waiting for more php support, i think netbeans can debug php scripts is it? the step through debugger?

The following IDEs support step through debugging:
eclipse (PDT)
Aptana Studio
Zend Studio
Netbeans
Note: Aptana Studio and Zend Studio are based on eclipse.

Related

GUI tool for php web development

Like visual studio where we have two section source and design for web programming,
is there any tool in linux where we can perform php web development which gives GUI+Source section for designing?
Something like drag and drop adjustment for GUI part.
PDT for eclipse maybe an option for you. Eclipse runs on PC, Linux, and Mac. Aptana studio has built in support for php and is also available for linux, last but not least netbeans has php dev tools also, Jetbrains WebStorm (its not free), but Aptana is also based on Eclipse but is specifically geared towards web development and has built in support for debugging and as well as built in support for git if that matters to you. I personally don't use netbeans.

Zend studio with wampserver?

Does anyone how I can use my already installed wamp server with my zend studio.
Do I have to make some kind of configuration for the studio to run on the wamp server?
Do I have to save my projects in some specific directory?
I'm totally new in php so pleas don't assume anything!
The simplest way to do what you want, is when you create a new Zend Studio project, you set its location to a directory under wamp www dir, so, if your wamp www dir is "c:/wamp/www", you create a project on "c:/wamp/www/ProjectName" then you can access it using http://localhost/ProjectName.
As for IDE, I highly suggest you try PhpStorm, it's the best php IDE out there (my opinion). I have tried PhpEdit, Komodo, NetBeans with Php plugin, Eclipse with PDT, used Zend Studio for years(I used from 5.5 to 8).
For using Zend Framework, the best approach is add it to the default wamp include_path, so you don't need to include ZF into each project code. Also, you can setup debugging using xdebug, wamp has support to it.
I would remove wamp and install Zend Server CE with Zend Studio since they're designed to work together. Alternately, you can use eclipse instead of Zend studio, it's based off eclipse. I've had better performance with eclipse but if your doing a lot of Zend Framework developing Zend Studio should be slightly more efficient.
My experience on Studio version 6.5 was that it was so bloated down and slow that I was actually quicker on eclipse, despite the additional features studio includes. Hopefully, they've fixed it by now.
Your IDE is your primary tool and it's important to use what your most efficient with. And that will change based on the requirements of what your doing. When your learning it's OK to use simpler editors, like notepad. I used vi and pico to learn Java.
You might find it easier to learn the basics in a simple text editor, like jEdit or notepad++. Then move into the production level IDE's and frameworks once you have the basics down.

Installing Aptana and Eclipse PDT - what should be main and what as a plugin

I would like to use an IDE for PHP Development using Zend framework & jQuery. I decided to use Aptana Studio. There is no PHP support in [Studio 2][2], so I have to use Eclipse PDT.
My question is should I install Eclipse PDT first and the use Aptana as plugin? or install Aptana Studio and then install Eclipse PDT as a plugin? What are pros & cons of each method if any?
Install the Eclipse PDT first & use Aptana Studio as a plugin. You will benefit immensely from this, as there is very good support of auto-information for each & every method & class / object, along with its properties. One thing you need to take care is that you must need to create a Project for each & every work / project, otherwise it (support for auto-information feature) will not work, because Eclipse will search for the main definitions of classes.
This good information support is not that much prevalent in Aptana Studio if you install it. So it's best to use it as a plugin with Eclipse PDT.
Also you will be able to upload files & use the File Manager with Eclipse PDT, when you have installed the Aptana Studio as a plugin. Eclipse PDT also has a nice debugging feature, along with other useful features (which I've not yet used).
Hope it helps.
here a step by step tutorial to install Eclipse PHP with aptana plugin or aptana studio with pdt plugin:
http://aptanaandpdt.blogspot.com
1 - Eclipse
2 - Aptana as plugin
As Aptana2 did not support php .... i thick will be better to use it as plugin
Aptana 3.0, still in beta, has support for PHP too (and Ruby on Rails and Python) http://aptana.org/products/studio3
No more in beta stage. 3.6.1 is available.
http://www.aptana.com/products/studio3/download.html

Profiler for Zend Server (Zend Debugger)

I'm looking for a PHP profiler that works with Zend Server (CE). From what I can tell, XDebug is a pain to setup with Zend Server. While Zend Debugger is free (as I understand it), the Profiler is only on Zend Studio.
Any other options?
I wish I could will you Zend Studio, as the profiler component is quite nice.
XDebug (standalone tip) may be your only option, unfortunately.
Do you have the option of upgrading to Zend Server 5 Professional edition? The Code Tracing feature would help you in profiling. Or, have you looked at PQP or DBG for Eclipse?
I wish I could be more help. The company I work for uses Zend Server for all deployments and the engineers all have Zend Studio.
Good luck.
A late answer, but might still be handy for those who find this question via searching (like I did).
I have Zend Server CE and PHPStorm on a Windows configuration and also wanted to profile some pages. It turned out that since a while it is just built-in in PHPStorm! With the explanation on this page: http://devnet.jetbrains.net/thread/432088 it was a breeze to get it up and running.
PHPStorm is not free (it is for individuals that do open source development) but its prices are absolutely affordable and are paid back for within days looking at the increasement in productivity.
You should consider the Semantic Designs PHP Profiler.
Doesn't require XDEBUG to be installed. Doesn't require any special configuration of your server. Works with huge PHP applications.

Which Eclipse version to install on Linux for PHP development

I have Slackware 12.1 and wish to try out Eclipse for PHP/HTML/JavaScript development. However, it seems I'm facing myriad of possible options and I'd hate to miss the best thing and give up on Eclipse (I'm currently using Geany, but I'm missing some stuff like , for example, auto-complete for JavaScript)
I'm currently looking into just installing All-in-one PDT package version 1.0.3 from here:
http://www.eclipse.org/pdt/downloads/
However, that seems to be Eclipse 3.3. There's also Slackware package for 3.4 here:
http://repository.slacky.eu/slackware-12.1/development/eclipse/3.4/
But it says it a "Classic" version. I'm not sure how hard would be to add PHP, HTML, JavaScript support for it.
Note: I don't plan to run PHP through Eclipse's integrated web server or anything like that. I just want a powerful editor.
P.S. Also, recommendations for something better than Eclipse that is for Linux and free are also welcome. I already used Kate, SciTE, Geany, Emacs, Vi and Bluefish, so those are not interesting.
Important: whatever you recommend, please explain reasons why. Don't rush to be the fastest gun in the west, as I'll downvote such answers that only say "use this"
I second Aptana wholeheartedly. Since it is based very closely off of Eclipse, if you ever decide to do coding that Aptana will not cover, you are still used to the general interface of Eclipse.
I don't want to say it is cut down, because it is not. It just has what you need for the languages and technologies you will be using it for. You can still add other plugins to it as well for SVN, CVS, etc. The interface is a bit less crowded as well.
I don't do a whole lot of javascript coding, but man, that is where is stands out from the crowd. It does a fantastic job with Javascript.
Also, you don't have to use Aptana's built in Jetty server to run PHP; you can just tell it where you local Apache server is.
If you want auto-complete for JavaScript, in that case you should to use some plug-in for Eclipse such as Aptana Studio, but Aptana is more than auto-compete tool for javascript, it has included a lot of unnecessary things that you don't need for regular development.
I have the same problem to find the right solution for JavaScript in Eclipse, Aptana was ok, but I hate the additional features that Aptana includes, I didn't find any good tool which could be added to Eclipse, for JavaScript :( For script languages such as JSP, Eclipse is like a song...nice,sweet and smooth...;)
I would recommend to use Eclipse 3.3 with PHP Development Tools. The All-in-one package should work fine. The great thing about using Eclipse as a PHP IDE is that you have great integration for Zend Debugger/XDebug and you can use common Eclipse Extensions like Mylyn or Subclipse also for PHP.
Eclipse 3.4 isn't useful for PHP Development at the moment because the final version of PDT 2.0 got delayed.
You could also take a look at Aptana or the current Netbeans 6.5 Milestone which both support PHP. Until PDT 2.0 they both provide better JavaScript Support than the current Eclipse 3.3 based PDT. Aptana is also based upon Eclipse.
I'm still using Eclipse 3.3.2 and PDT 1.0.3, and I'm pretty happy with it. I tried upgrading to Eclipse 3.4, using a few recent builds of PDT 2.0, but it was buggy. It would hang for a long time in certain situations (like when I was copying text in a PHP editor). And it would keep re-parsing all my code every time I re-launched Eclipse, which took forever. These issues will probably get fixed eventually, but I'd hold on unless you really want Eclipse 3.4.
Aptana is a good choice, dedicated Eclipse clone for web development.
I personally use Krusader's editor, which is crippled version of Kate (KWrite). Fast, nice code highlight, and many useful shortcuts (like Ctrl+D to comment selection language wise).
Javascript with PDT Eclipse and the plugin jseclipse makes all your problems go away! :)
With jseclipse the regular "Goto function with F3 keyboard press" works.

Categories