You are here

eclipse

Eclipse Copy not working

I always had a problem with Eclipse under Linux whereby Copy (Ctrl-C) rarely worked first go. I learned to copy twice to ensure the text was placed in the clipboard.

I've happily run Eclipse on the Mac for more than a year now without such problems. But last week I let 3.5 do a self update - just a few minor updates bringing it to 3.5.2.

Afterwards Cmd-C became unreliable much like under Linux.

Anyway, I found a fix. Open Eclipse's main preferences. Go to General->Keys. Search the key bindings for 'Copy'. Erase the key binding (which will show "Cmd C").

Cmd C now works. Perhaps Eclipse and MacOS were both trying to capture the keypress and neither got it correctly.

Keywords: 

Debugging in Zend Studio for Eclipse

I've been playing with the Zend Studio trial and found it to be really good. Eclipse is an excellent PHP editor but Zend manage to bring some of Eclipse's real power to PHP, that which you can see when writing code in Java.

One useful tool is local debugging. Yet Zend Studio's built in PHP doesn't include extensions such as MySQL, making it not overly useful when you start to use it properly. Now, at this point you should perhaps be running the code on the server and using remote debugging, but what about unit tests? Another excellent feature in Zend Studio is the PHPUnit support. But you can't test MySQL methods as there's no support.

So, here's how to get PHP extensions working in Zend Studio 6 (on Windows, anyway - yes, this is what I use at work..)

Locate the PHP directory inside Eclipse's plugins. You can find this by looking at the preferences for the PHP executable.
Download the binary archive (not installer) of the same PHP version from php.net.
Copy the extensions from the ZIP into the PHP directory.
Edit the php.ini in the same directory and add the line:

extensions_dir = .

(Note: PHP claims to be using c:\windows\php.ini - it is not).
Open the default php.ini from the ZIP you downloaded, and copy all the extension (.dll) lines to your live php.ini.
Also manually add php_mysql.dll and php_mysqli.dll, which are NOT compiled in to Zend's PHP as the example php.ini file says (Zend's php.exe is a special build I believe).

Now try debugging some PHP which uses extensions, and it'll work. Unless you have bugs. Then it'll need debugging.

Keywords: 
Subscribe to RSS - eclipse