MacGDBp, but better? - php

For debugging php code I use MacGDBp but it has its quirks: it shows only the top frame variables of the stack, it sometimes refuses to display any variable at all and last version has decorates the source text with non ascii characters.
Is there any alternative that is native OS X? (ie. not Eclipse, I can't stand it).

I have also used MacGDBp and became frustrated with the limitations you mentioned. While it is not a native app per say, NetBeans 6.5 and higher is free and includes a decent PHP debugger that works with XDebug.
http://netbeans.org/kb/docs/php/debugging.html
It is not without it's own set of issues, but it does seem to be more reliable than MacGDBp.
If you are not opposed to paying, the Komodo IDE (My IDE of choice) also has a PHP debugger.
http://www.activestate.com/komodo-ide?src=AScom&type=bn&X=HP&campaign=KMD
Also, though slightly off topic, you may find the easy Xdebug FireFox extension useful:
https://addons.mozilla.org/en-US/firefox/addon/58688/
Lastly, the XDebug website has a list of additional clients, browser plugins and instructions on how to use them:
http://www.xdebug.org/docs/remote#browser_session

For Linux users - http://protoeditor.sourceforge.net/ has a nice lightweight client for Xdebug which is also available as a plugin for Kate (this is not mentioned on the Xdebug site)
Xdebug also runs happily with XAMPP - if you figure out where to put the compiled .so file ;)
There also is an article describing on how to install Xdebug on Linux w/ XAMPP on the SaniSoft blog: http://www.sanisoft.com/blog/2007/06/23/how-to-install-xdebug-php-extension-for-xampp-on-linux/

http://debuggable.com/posts/setting-up-xdebug-on-mac-os-x-or-win32-linux:480f4dd6-0240-4a90-8fa1-4e41cbdd56cb
That helped me a lot. Perhaps it helps you as well.
Edit: By the way, it is a PHP extension. It can be used in competent IDEs including Netbeans, Eclipse, AS Komodo... Oh, and you may use it manually as well by setting a special GET variable (or COOKIE) (see xdebug manual for more info).

Related

PHP7 language support for PhpStorm

I know PHP7 isn't released yet, however I would like to start trying it out, and to do this I would ideally like to keep using PhpStorm. The problem naturally is that it doesn't yet have language support for it.
I have compiled the PHP7 source and added it as an interpreter to PhpStorm, which surprisingly it accepted, however this made no impact on the language level. So my guess is the interpreter is for debugging and the IDE uses its own parser to debug code.
Has anyone found a way to get support for PHP7 into the IDE? even if its the messiest solution in the world, it would be enough.
That's not possible with current versions on PhpStorm -- it has to be natively supported by IDE.
Support for PHP7 will come only in v10 (e.g. no mention for v9 in current roadmap -- no need to support something that is still work in progress, especially since v10 will be released close to PHP7 target dates).
UPDATE ( 21/05/2015 ):
Based on today's tickets it's quite possible that PHP 7 support will actually be added in PhpStorm v9.
UPDATE ( 22/05/2015 ):
Master ticket: https://youtrack.jetbrains.com/issue/WI-27468 (check linked tickets for particular features).
UPDATE ( 08/07/2015 ):
PhpStorm v9 has been released with very basic PHP7 support.
I have compiled the PHP7 source and added it as an interpreter to PhpStorm, which surprisingly it accepted, however this made no impact on the language level. So my guess is the interpreter is for debugging and the IDE uses its own parser to debug code.
Generally speaking -- you are correct here.
Interpreter is used to execute and debug your local (or remote via SSH) scripts and other external stuff that required specifying php executable (e.g. PHPUnit tests etc). It is also used by built-in simple web server if it's used to serve your pages.
At the same time specific language level (5.4, 5.5, 5.6 etc) is set separately and requires IDE to know about such new constructs/syntax etc which means it has to be coded first (as IDE has its' own PHP parser/lexer).

IDE for PHP and Python Windows

I used to use netbeans for a while and really liked it.
But now, I wan't to expand my toolbox with Python, and Netbeans dropped support for Django, also Python support seems to suck in NB 7.0.
So I am looking for recommendations on IDE or Text Editor for Windows with support:
Python (possibly with Django)
PHP
HTML, CSS, JavaScript
FTP
GIT & SVN
I know Aptana 3 can do this, is there anything else?
I don't know Vim a lot, but would that be an option?
http://www.jetbrains.com/pycharm/ would be my first choice. JetBrains does a great job with making the editor valuable to you for more than just text entry. The different IDEs JetBrains offers are all basically the same even if they are configured for a slightly different language set.
Eclipse is an option, it has plugins for everything. I've never been much of a fan of Eclipse though. It's really plugable but not a great IDE compared to some of the other options.
EasyEclipse
Well Aptana is built upon eclipse, so you could just use the basic eclipse with all your necessary add ons.
Obviously you'll need Pydev for the python stuff and that has Django integration.
For some reason though I actually prefer netbeans for my php ide.
Tbh just try out a few and see which one you like best.
Eclipse and Visual Studio have plugins for just about everything. Eclipse is free, I think for Visual Studio though you'd have to get the professional version to run plugins...
NetBeans - If you are using 64-bit Windows do not hurry to install updates on 7.0+. 6.* is working fine.
You have ftp and you can set to upload on run of the project or on each save. You can download Python plugin by adding this url. It is not the best but it worked for me.
It is stable engough and powerful, since the eclipses are very buggy to me.
Aptana is currently the eclipse for web projects, and the people who are creating it are also the creators of pydev, so it would be my second choise.
Visual Studio's plugin VC.Php (Paid) is also powerful, because Visual Studio environment is good, but the plugin is buggy, too and sometimes seems to be updated with dalay of new suff, as whole it would be my 3rd choise.

What to do to dubug/execute an existing PHP project

I am beginner to PHP. I want to debug/execute an existing PHP project. I have already installed Eclipse as IDE and what else should be installed in my system (OS is Windows xp).
And what and all settings should do in that...??
I request you to invest few seconds for this "Kid of PHP".......
I would recommend installing xampp, it allows you to run a website on your local machine.
php and a web server would come in handy ;-)
http://windows.php.net/download/
http://www.apache.org/dyn/closer.cgi
Firephp is a Firefox extension. It works as a module of Firebug. After you install it and add the php library to your code your messages will appear inside the browser. A real quick and clear way to debug in php.
Since you said you are a beginner, it is better NOT to go after advanced debuggers like xDebug at the moment.
print_r(); die;
is the best debugging tool for you now.
Also if you want to nicely format the output of print_r() when arrays or objects are shown, do this:-
echo '<pre>', print_r($array), '</pre>';
And Eclipse! If you are a beginner (or pro), definitely go for NetBeans. NetBeans comes with built-in support for xDebug and zend debugger and a lot other cool stuff you can use when you learn more. If you are going with Eclipse, you will need to install Eclipse extensions like PDT for making Eclipse support PHP.
Of course you will need a web server with PHP support. If you already don't have that, install xampp as somebody mentioned earlier. That's the easy way to get the web server running quickly.
NetBeans is just great, everything works out of the box. Very little to configure. (I'm a former Eclipse user)

Is there a true all-in-one solution for PHP Development?

I'm looking for a "SINGLE INSTALLER" solution for PHP Development.
Is there anything out there which will give me a nice IDE, Web Server, Debugger, Database, etc, on a single install image (*.msi or *.exe)?
This of course would be completely opposite of Eclipse PDT, which requires you to search and locate a bunch of additional components which never quite work together.
I think you should go for a separate install for server (web, database) and one for development (IDE, debug) -> Zend or PHPed ?
I think the question is: Does there need to be a true all-in-one solution? I think not.
I agree it's bothersome to have to put dozens of pieces together, but I find a combination of XAMPP, the IDE of my choice, and a few additional bells and whistles (like Polystyle for source code formatting) totally flexible, and not too much work to install.
I don't know if you'll find all of what you're looking for in one package for Windows, but you can get it narrowed down to about two...
XAMPP for Windows comes with: Apache, MySQL, PHP + PEAR, Perl, mod_php, mod_perl, mod_ssl, OpenSSL, phpMyAdmin, Webalizer, Mercury Mail Transport System for Win32 and NetWare Systems v3.32, Ming, JpGraph, FileZilla FTP Server, mcrypt, eAccelerator, SQLite, and WEB-DAV + mod_auth_mysql.
Then you just need an editor with a debugger, which there are many choices, mostly non-free, such as NuSphere's PhpEd - or free - such as Eclipse PDT or gVim+XDebug+DBGp client.
True one-in-all - not yet. Maybe someone reading this will upload a version.
My tip would be:
XAMPP and Netbeans (The PHP bundle).
2 clicks to install.
3 clicks if you don't have java installed already.
Netbeans is a nice IDE for PHP, too. I use it all the time and I'm much more satisfied with than with Eclipse PDT. It comes in one neat bundle, that you can just install and use right away.
Just download the PHP bundle here
As for a web server, I can recommend XAMPP or Zend Server. They are both easy to install and do a good job. XAMPP has MySQL on board while Zend Server has some really cool optimization features for great performance.
Should it be a requirement that your development environment is easy to install? You're a developer so, you should be able to install and configure a set of (more powerful) tools that suit your specific needs.
You'll only install your bundled IDE once (every so often) so that feature no longer is of benefit when you're developing your projects. It's more likely to become a hindrance as you struggle to configure your environment.
Take a look at Komodo IDE also.
If you're on windows you can get a WAMP package for web,php,database. For IDE I do like Zend Studio 5.5. Not their latest interation based off of PDT. 5.5 has a nice debugger and a built-in web browser that you can view output. The interface is pretty fast, running your code through the debugger/browser is slower than on a real webserver, but ofcourse you get the nice perks of breaking,inspecting your code. The only drawback is that Zend Studio 5.5 is not supported anymore and the highest PHP version that works with it is 5.2.13.
Currently though I have a Virtualbox Ubuntu Server image that mirrors my production enviroment, except it has Samba installed so I can easily copy files back and forth.

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