Debinaize It

July 3, 2008

Debug PHP scripts in Netbeans IDE

Filed under: programming — Tags: — zaher14 @ 4:57 pm

Are you having problems in finding pesky quirks in your PHP scripts and swelling your fingers by writing print_r in almost every lines? This tip is just for you …

  1. Download and install “Early Access for PHP” bundle of Netbeans from http://download.netbeans.org/netbeans/6.1/final/ .
  2. Download and install an appropriate PHP-Mysql distro. I’m using MAMP in my Mac OS. Another good platform independent option is XAMPP.
  3. Download the appropriate version of xdebug from http://www.xdebug.org/ matching your php version (use phpinfo() in your web server to grab that). In my case there was no Mac OS binary, so I had to download the source. If you are downloading binary package then you can skip to step 7.
  4. Unpack the source and open a terminal in that folder.
  5. Now run [Note: make sure phpize and php-config is in your path]:


$phpize

$./configure --enable-xdebug

$make

  1. A file called xdebug.so (in Linux and Mac OS) or xdebug.dll (Widows) will get created. If you have downloaded binary package, your package will contain this file.
  2. Now copy this file into the extension folder of your server. In my case it was like this


$cp modules/xdebug.so
/Applications/MAMP/bin/php5/lib/php/extensions

  1. Now open your php.ini file and add entries for this new extension

zend_extension = "/Applications/MAMP/bin/php5/lib/php/extensions/xdebug.so"

xdebug.remote_enable=1

  1. Now fire-up Netbeans and create/open your php project. Now insert a breakpoint by clicking anywhere in the left margin, now try to debug the file by selecting debug from context menu. You should see your web browser being fired and probably a blank web page. Now press F7 to step into your code and see it execute step by step. Try adding some watches. As the whole page finishes executing, you get to see the result in your web browser.

Happy Debugging!!!

Update 5 July 2008:
Just found out this link for configuring xdebug with netbeans in Ubunutu 8.04.

June 7, 2008

FlazX eBook search plugin for Mozilla Firefox

Filed under: programming — Tags: , — zaher14 @ 7:36 pm

Flazx.com is one of the best sites that I have come across for free e-Book download. With its huge collection of e-Books it never disappointed me.

Here is a plug-in I made for myself to make my search of e-Books easier. Just paste this file in any of the following folders:

/Applications/Firefox.app/Contents/MacOS/searchplugins (in MacOS)
/usr/lib/firefox-addons/searchplugins (in Linux)
C:\Program Files\Mozilla Firefox\searchplugins (in Windows)

Now when your restart your Firefox, you can see an extra search option in your search bar. Select that and search for the e-Book you want.

Note: There has been allegations that Flazx.com infringes copyright laws by making unauthorized copies of e-Books available online. I’m not responsible any inconveniences you may experience while browsing this site.

May 13, 2008

Nokia 3110c iSync plug-in: Part 1

Filed under: MacOSX, programming, Tips and Tricks — Tags: , , — zaher14 @ 8:07 am

Here is an iSync plug-in that I have made for my Nokia 3110c.

You can download it form here.

Just unzip the file and paste it inside /Applications/iSync.app/Contents/PlugIns/AppleneConduit.syncdevice/Contents/PlugIns/

I made this plug-in by editing Nokia 6102′s existing plug-in. So you will need to delete Nokia-6102.phoneplugin file before pasting this file into that folder, because it conflicts with that phones plugin.

I am trying to build one from scratch, hope to finish that soon.

Here you can see the working status of this plug-in.

Theme: Silver is the New Black. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.