I recently wanted to get a decend IDE for my PHP side-projecs, and by searching SO found Eclipse+PDT. Although it's not quite at the level of Visual Studio yet, it's pretty nice and better than Notepad++ for this purpose. I can even debug somewhat, although it's pretty glitchy.
But there is one thing that is bugging me. It seems to have some kind of weird performance issue, whereupon it it uses lots of CPU about once a minute or so. By itself this is not noticeable, but if you do something else at the same time (like watch a movie, or play Quake 3), it produces an annoying hicup now and then.
Granted, my computer is not state-of-the-art (Sempron 2200+ with 1GB of RAM), but then it's certainly more than enough for all of this.
Another performance question is that I'm used to Visual Studio where IntelliSense pops up as soon as you type a compatible symbol. Here you have to wait for a moment. Is there any way to make it open up instantly?
P.S. Perhaps there's an even better freeware IDE for PHP?
Added: It was suggested by Stefan Schmidt to change Auto-Activation speed. It seems that there is a bug with this. The smaller I set it, the more it fails to open at all. For example, when it's 200, it opens mostly all the time when there is something to open. At 10 it doesn't open (at least) for static class members. What gives?
I think I found it !!!
Given:
a) That Eclipse for PHP (Eclipse PDT) is updated just about everyday complete with daily builds. I can only assume this is from a team of very dedicated and competent developers who only want the same thing you do.
b) That only a small portion of us have been coming here complaining about our CPU maxing out while trying to edit PHP code.
Observations:
a) I have turned off just about every item in the preferences box to no avail.
Solutions:
In my past experience with software, especially large black boxes that normally work well for others. When faced with a situation that does not seem to respond to conventional theory... I like to do the unconventional. In this case... simply take care of the "little things".
In this particular case this means that I:
Did an update via Help->Check for Software Updates
Installed the latest updates
Removed the old workspace and created a new one
Paid attention to ALL THE WARNINGS, especially the YELLOW warnings which kept pointing to all the HTML errors in code that I either wasn't really using or meant to clean up anyway.
In other words...
Once I eliminated ALL THE WARNINGS.... The CPU stopped maxing out !!!
After updating the to latest Eclipse build and then taking the time to either fix the warnings and/or remove ALL unnecessary source code (that was slated to removed anyway)... the CPU returned to "normal".
In other words...
The problem was not that Eclipse PDT wasn't working properly...
...it was that it was working TOO GOOD !!!
It was doing precisely what it was designed to do... check ( & recheck ) for warnings in your source code while the keyboard was considered dormant.
So...
There you go...
Pay attention to ALL the warnings in your "Problems" window and do what it takes to reduce the number of warnings to ZERO !!!
And then report back here with your findings.
I honestly cannot believe just how well my Ubuntu 10.04 (32 bit) installation is operating on a $500 Compaq Presario. It's a dream and ALL I did was take care of the "little things".
Cheers,
Perry
It could be the garbage collector. Try a different JVM or a different garbage collection algorithm. It might help you shorten the pause times. With JRockit you can set a pause time target for the garbage collector.
For instance you could set:
-XgcPrio:pausetime
-XpauseTarget:250
in you eclipse.ini file. See this blog for some information on how you can set up Eclipse to run on JRockit
you could try this:
Selec Project => clean from menu and select all php projects. This could take a while ( if you have many/large projects ), but then it should get faster.
For an alternate free IDE you could try NetBeans. From version 6.5 it has full php support, and for me it's faster than Eclipse+PDT, and more stable / memory consupting.
There are known issues with PDT 3.1 and eclipse 4.2 (juno).
https://bugs.eclipse.org/bugs/show_bug.cgi?id=385272
This is the solution:
Open a different perspective (for example java, but not php) and restart eclipse. Afterwards you can savely switch back to php perspective. Eclipse will have no performance issues.
Also mentioned here
For your second question:
Go to Window->Preferences ...
From there go to PHP->Editor->Code Assist
At the bottom is a box called Auto-Activation.
There you can specify the delay it takes for the Code Assist to show up.
I have no solution for your other problem, but perhaps if you wait until 29th of December your problems will be solved by the 2.0 version.
Edit: Not a solution, but perhaps a workaround: Try lowering the prcess priority of your PDT process.
Ive had no hiccups using PDT with Ganymede .. you might want to try (as an experiment) downloading and copying eclipse from the All-in-One Eclipse PDT + Zend Debugger Package zip and see if it runs better?
You can use multiple different eclipses as they don't need any installation and won't interfere with each other - just open and use
There is another project for adding PHP support to Eclipse: PHPeclipse. I know that when PDT was still young, people often choose PHPeclipse because of performance problems with PDT, but I cannot say, how the current versions of both compare with respect to performance (and features), as I quit my PHPeclipse development activities quite some time ago.
If your performance problem is a real show stopper, you might want to give PHPeclipse a try.
Related
I'm trying to track down issues with an application [modx] I have several of these sites [about 10] on my server & was wondering how I can see what php is doing.
Pages on these sites are extremely slow while the same sites in dev are fine as are other php applications on the server.
I tried using xdebug to get an idea of what php was doing while processing these pages & where the bottleneck was occurring, but it only appeared to want to do anything on an error [there are no errors being thrown]
Any suggestions on how to track this down?
[linux/Centos5/php5.2.?/apache2]
Xdebug and webgrind are a nice way to see where your bottel necks are...
Read XDEBUG_PROFILE and Webgrind
Set up the php.ini to have xdebug profile your code on every run or if a special param is passed, then setup webgrind to read from the same directory xdebug writes its profile dumps to.
Webgrind will show you what functions and set of functions require the most time, it breaks it down and makes it easy to find slow and/or inefficient code. (eg. your script is calling "PDOStatement->execute" 300 times on a fast query [Or calling it once and a massively slow one] taking up 90% of the execution time).
The most commonly used tool, for finding bottlenecks in PHP, would be Xdebug. But you should also manually examine the codebase.
There are three different areas where you will have to focus on:
frontend performance
SQL queries
php logic itself
.. and the impact on the perceived speed is in this order.
You should start by running ySlow, and make sure that your site follows the guidelines as closely as possible.
The next step would be tracking down what SQL queries are executed, and (assuming you are using mysql) try to run them with EXPLAIN. Also, check the queries themselves. There might be some extremely stupid code there, like ORDER BY RAND() or use of LIKE in huge tables.
And the last stage would fixing it all would a hard looks at the code itself. Both on PHP and JavaScript side of things.
Also , you should upgrade to PHP 5.3, because your version is extremely outdated.
Usually when you don't know what you're looking for, you cannot spot it with tools like xdebug or other plugins/debug bars etc built into CMS/Framework, new relic is the simplest solution - you'll be able to spot bottlenecks after few min.
while new relic is a paid app, you can test if for free for first 14 days - it's more than enough to find problem.
It's great because it integrates all other tool's and data sources you usually use:
xdebug, cpu & i/o monitoring, mysql slowlog, queries log.
It will also show you if your app is slow on php/DB/frontend/network.
You should try it out instead of wasting time for debugging with other tools.
here is a guide for centos installation: https://newrelic.com/docs/php/php-agent-installation-redhat-and-centos
I'm a PHP developer and I use Eclipse on Mac (through Java VM), however - it seems to be very slow responsive when working with large source files (sometimes it is inevitable to edit such files).
That forces me to open subject file in some editor like TextMate or TextWrangler because these two handle large files much better than Eclipse.
I assume this is because Eclipse is driven on a Java VM, and probably TextMate and TextWrangler aren't (not sure though)?
Therefore, I'm wondering if someone could recommend some good IDE for PHP/JS for MAC OSX not based on Java VM (TextMate and/or TextWrangler are too narrowed to be used as IDE)? It is not important for such IDE to be freeware, as long as it is not too expensive.
Thanks in advance,
Radovan
Don't underestimate the power of TextMate. The Emacs style macros can do a lot very quickly. Still, aside from the intuitive shortcuts and macro's the program is rather "dumb".
Coda by Panic is a good step in the right direction. I usually alternate between the two depending on what I'm working on.
There's actually a lot of support for PHP related tasks in Dreamweaver but... it's Dreamweaver so, it has the same "fatty" problems that most Java based apps do.
There's a program call Espresso, I believe by macrabbit, that's rather similar to Coda, but in the brief time I gave it, preferred Coda.
XCode can handle PHP projects, but it's clearly not the right tool for the job. The file merge program that it comes with is very useful though.
OS X is really missing a clean, intuitive, cocoa based PHP/JS/CSS editor that includes things like code sense, macros, code folding, project management, version control integration. Coda's the best start IMHO, but still not a home run.
I don't know about non-JVM PHP IDEs, but loading big files is not an "intrinsic" problem of Java VM (the VM can handle big files as the same way as a native application, so the problem is not there.. how the IDE renders the editor could be another cause).
If you couldn't find a good non-Java VM alternative, there are some things that you could do to improve the performance with large files by change the JVM startup parameters used by Eclipse (you can do something similar for other Java based IDEs).
Show the package contents of your Eclipse.app and edit Contents/MacOS/eclipse.ini
At the end of that file you have JVM startup arguments you can look into the JVM documentation
A parameter that will affect the performance with large files is -Xmx which indicates the maximum memory available for the Java application, if the value is low or not present (the default is low for the IDE needs) your IDE will be slow because it spends a lot of time doing garbage collection (in Eclipse you can check if this is the problem by activating Eclipse->Preferences...->General / Show heap status -or something like that)
Here is an example of the startup parameters that I use for Eclipse (I'm using a MacBook with 4Gb of RAM):
-XX:PermSize=32m
-XX:MaxPermSize=384m
-Xms20m
-Xmx1024m
-Xss2m
-Xverify:none
-XX:+CMSClassUnloadingEnabled
-XX:+CMSPermGenSweepingEnabled
-Xverify:none turns off JVM bycode verification and makes Eclipse to load a little bit faster.
-Xms20m (is the initial heap size) is low.. the JVM will allocate more as needed, a big value maybe is better for other kinds of apps but in this case it makes Eclipse slower to load
-Xmx1024m use 1gb as maximum heap (I work with big Java projects and the heap never reached more than 600m)
I found my Mac Air battery was getting annihilated with Netbeans normally 8-10 hours usage down to about 1-2 with background scanning disabled, not good if your travelling!!
TextMate. Extremely lightweight,unnoticeable on consumption but has all the normal syntax features and GIT integration. When I'm not on my desktop this is the answer.
I've recently started using PHP for OO development. On OSX, I have outgrown Coda and feel like Textmate takes more time to set up than to actually use. I've downloaded a few of the "real" IDEs, but I feel like they are overkill and I can't find any way to ease myself into it and/or they are way too busy.
I'm looking for something that does code folding, validation, can colorize PHP/PDO/HTML in the same document, and hopefully do completion of my classes and methods that doesn't require 6 months to be productive again.
Can anyone throw me a bone?
Aptana
Eclipse PDT
Netbeans
Kate
Currently I'm using Aptana Beta 3 and there are a couple of bugs, but with the new IDE coming out in a couple of months it should be great. Been a avid Aptana user for a couple of years now.
NOTE: Aptana was Acquired by Appcelerator
I personally use netbeans 6.9.1 and have been very happy with it. Here are my favorite features:
-- functions, classes, comment blocks and other structures are automatically set up for code folding, but you can also highlight any block and make an arbitrary code fold.
-- syntax highlighting is good
-- full support for new php 5.3 features (namespaces etc.)
-- the autocomplete works, but also stays out of the way when I don't need it.
-- refactoring works really well
-- it has a lot of built in macros, plus you can create your own
-- it does nice, fast code validation.
-- completely supports xdebug through a local/remote web server.
-- has built in symfony support
-- tracks polymorphism well
-- I program a lot of c/c++ and java as well, so its really nice to get familiar with just one IDE.
-- it has seamless built in supprt for SVN/CVS and other SCMs. Things like renaming/deleting a file in the IDE play nice with your SCM. You can also commit, update, diff etc. in the ide. It also does live diff via colors on the left hand side.
-- I really like the scm diff features.
-- the learning curve isn't too steep, I feel the IDE's features/commands are pretty intuitive.
Overall I have been really happy with netbeans. I have used a lot of other IDE's and none of them are bad, but they just lack certain features that I need. netbeans is not perfect either, but for me its the best IDE I have been able to find. The things I don't really like about netbeans are:
-- everything has to be a project, you can't just work on some code without netbeans creating metadata. However, the location of the metadata storage is customizable, so it doesn't interfere with your source file directory structure.
-- profiling doesn't really work unless you install some weird solaris stuff.
-- it can't mount an svn+ssh working copy, you have to pull it down locally. if you want to use the SCM features.
-- it can be a little slow if you have a lot of large projects open at a time. You can close the projects so netbeans doesn't scan the source code continuously, and that helps. Re-opening a project isn't too slow or difficult either.
All in all, netbeans isn't really breaking any new ground, vim, eclise, phpide and others all do similar things. I just feel like those things work better in netbeans and are easier to access.
hth
I have to suggest vim despite potentially not meeting your last requirement: "doesn't require 6 months to be productive again".
Vim does everything you listed, but has a very steep learning curve. Not likely six months, but you will be fumbling around for a while. In the long run it you'll probably find it worthwhile.
I use Eclipse PDT on a regular basis, but have been thinking about checking out PhpStorm. It looks like it could be a nice alternative (albeit not free).
I suggest use of Nusphere php ide , its too great for php, it has auto complete features and in built server and you can debug run time, you can also set browser for debugging your code , its true php debugger, i am using this debugger since last 3 years ,it’s amazing and it has inbuilt ftp feature so you can also debug your ftp file.
I've been battling with several IDE's so far without much success, so I decided it would be ask someone wiser. I'd love one to have these features:
Fast code completion;
Completion for HTML (with tags and tags' content), CSS and, preferably, jQuery;
Debugger which can work with WampServer installation;
Completion for native PHP commands as well
Shortcut to go to a file in the current project/workspace (like Ctrl+Shift+O in Netbeans) --> What I meant here is that a shortcut to open a window, where you can type beginning of a file name and it will show you all matching files in project; so a way to navigate the project with keyboard only.
I have already tried some of IDE's:
Netbeans:
It is slow, really slow. The slowest IDE of them all I believe
Debugger had issues and overall I failed to make it work
You can barely customize auto-formatting (at least in the way I'd like to customize it) - you can either disable it or live with it
I am using it right now but strive to change it!
Eclipse PDT
Kinda slowish, though faster than Netbeans
There was no code hinting for native PHP commands #_#
After restarting IDE, the Debugger decided to stop adding ?X-DEBUGwhatever stuff to links and it stopped working as result
Subclipse didn't work!
Nusphere PHP Edit
Fast and shiny, good for my netbook, but there is no "Go to file" command
No JS hinting
Komodo and PHPDesigner 7 were disqualified for some reasons I can't really remember now but they were severe.
I tested a wide variety of IDE's but there is a real lot of them and pretty difficult to test them all, which is why I'd appreciate some input about one which fits all the above specified needs.
Consider vim. It's painful at first, but it does meet all of your requirements, unless you also have a (as of yet unspoken) requirement for a Graphical User Interface.
Fast Code Completion: Fastest I've ever encountered, C-x C-o
Yes, Yes, and Probably.
vim can use xdebug to get this functionality. How to set up on linux.
Yes.
:o supports tabbed completion even.
PHPStorm is a relatively new contender in the IDE scene by the people who make IDEA and Resharper. I can't say it's blazingly fast, but it's geared specifically toward PHP and has a lot of nice features. I feel it is a considerable improvement over Netbeans or Eclipse.
You might want to try the pre-release of the next version, since they've added a lot of new features.
Funnily enough I decided to settle for Aptana 3 Beta. Though lots of features don't work it is awfully quick and I love the antialiased font. Thanks to all for help anyway!
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have absolutely no idea about version control. Only that it can be very useful in many ways.
I have found a few related questions but none that start from the absolute beginning.
I am the only developer at my work using Mac OS X and traditionally just been using FTP.
Can anyone help me with version control in relation to PHP projects (does it matter)?
Yes, try it out, it's worth it. And the language you are using doesn't matter. It's working great with PHP for me and it will for you too.
Benefits
If you are the only developer, it is indeed easier to go without version control. However, you will find great benefits to using a version control system. Some of the easiest benefits will be:
Never wondering what is your latest version once you go back to a project (no more myproject090201-archive2-final6.zip)
Never fear to start off some major refactoring, if you make a mistake on your file, you'll just rollback to the latest version
If something stops working in your project and you have the feeling it worked at one point, you can test some of the prior versions easily and look at the difference between the working version and the non-working version to find what broke the code
Additional backup of your current project, and even better if it's not on your machine... of course, additional points for backing up your version control system, we're never too cautious, you don't want to have to restart that month-long project do you?
Choices
As some have said, you have a few choices for your version control system and I guess you'll want a free one to begin. There are a few excellent commercial products but the free ones have nothing to be ashamed of. So here are some very popular free version control systems:
Subversion (also called SVN)
Git
Mercurial
Bazaar
Centralized versus distributed
Subversion has been there for a while and it's one classified as 'centralized'. Meaning everyone will always go fetch the latest version and commit their latest work to one central system, often on another system although it can easily be on your own machine. It's a process easy to understand.
The three others are called 'distributed'. There's a lot of different possible processes as it's a more flexible system and that's why those three newcomers are getting a lot of traction these days in open source projects where a lot of people are interacting with one another. Basically you are working with your own revisions on your own machine, making as many copies as you need and deciding which versions you share with other people on other computers.
The trend definitely seems go towards distributed system but as those systems are more recent, they are still missing the GUI tools that makes it really user friendly to use and you might sometimes find the documentation to be a bit lighter. On the other hand, this all seems to be getting corrected quickly.
In your case, as you are working alone, it probably won't make a big difference, and although you'll hear very good points for centralized and distributed systems, you'll be able to work with one or the other without any problems.
Tools
If you absolutely need a GUI tool for your Mac, I'd then choose SVN to get initiated to source control. There are two very good products for that (commercial):
Versions
Cornerstone
And a few other ones (such as the free svnX) that are becoming a little bit old and unfriendly in my opinion but that might be interesting trying anyway.
If you don't mind not using the GUI tools, with the help of Terminal you'll be able to do all the same things with a few simple command lines with any of the aforementioned systems.
Starting points
In any cases, you'll want some starting points.
For Subversion, your first stop must be their free book, Version Control with Subversion. Take a few hours of your day to go through the chapters, it'll be time well invested. The introduction chapters are a good read even you don't want to use Subversion specifically because it'll get you to understand version control a little bit better.
For a distributed system, I've had fun with Mercurial but it's an easily flammable subject so I'll let you make your own choice there. But if you end up looking at Mercurial, have a look at this blog post, it was an excellent starter for me that'll get you up and running with the basics in a few minutes if you're already a bit accustomed to version control in general. Anyway, drop by Mercurial's homepage and have a look at the Getting Started section of the page.
Conclusion
Give it a go, invest a day trying it out with a few bogus files. Try out renaming files and directory, erasing, moving things around, committing binary files versus text files, resolving conflicts and reverting to older versions to get a hang of it. These are often the first few hurdles you'll encounter when playing with version control and it'll be painless if it's on a non-production project.
In any cases, it's something well-worth learning that'll be helpful with your solo projects as well as if you end up working with other developers at your current job or your next one.
Good luck!
The type of code is irrelevant.
One open-source and popular version control system is Subversion and there is a very good overview/manual here.
I use Git for PHP development.
It's fast, flexible, reliable, clean (CVS and SVN create a lot of hidden folders that I personally don't like).
Its distributed nature allow to work the way you want (with or without a central repository).
You can find more about it here:
Gitmagic
Speed Benchmarks
Moreover, you can get the Eclipse PDT (PHP Plugin) and use Subclibse in the IDE.
Versions is working well for another developer I work with. Additionally, if you are using Textmate the SVN bundle provides pretty much all you need for most parts of the Subversion workflow. I really like it.
The Project Plus plugin takes it a step further by adding small unobtrusive badges to versioned files in the project tree, showing at a glance the state of files in a project.
If you're on a Mac, do yourself a favor and pick up Versions, a beautifully designed (and highly functional) Subversion GUI. You'd do best to learn the terminology and get an idea of how Subversion works using a GUI before you jump to the command line. Once you're able to commit revisions of your code and run updates to get other people's work, then go back and read the red bean book (it really is the best way to learn Subversion in-and-out).
http://versionsapp.com/
use bazaar http://bazaar-vcs.org/
it's very nice and you can start using it in minutes.
Check out other options too - Miscrosoft's TFS (this not only used for source control system but for defect tracking, project management etc etc) , Bazaar, Git are popular ones.
Alex,
Version control (and some will scathe me for this statement) is not a trivial matter, and even very experienced developers get themselves into trouble. The most frequent causes for frustration are limitations of a particular product (Visual Source Safe is a famous one), and members of a team not following the same process, or not understanding the process at all.
This should not stop you from looking into using a source control tool - the opposite is the case. You can only use a tool effectively if you understand what it does and why.
I would recommend that you look into CVS. It has been around for many years, it is relatively simple to install, set up, and use, and while there are GUI clients available for most platforms, learning it from the command line may provide the best access to its features.