headbanner

Menu:

nigel-1

Quick Notes:

April 20th, 2008:
Ruby is all syntactic sugar once you get into it. Its not a bad thing, but one should remember that. Rails does too much at run time, and I'm missing JavaScript. Need to finish my XUL based XDebug client for PHP.

Read more...

About Nigel

Nigel is a consultant at ThoughtWorks, seeking a code free nirvana. Unfortunately he's missed the second left.

Previous Posts

- Implementing the Observer Design Pattern with PHP

- Dynamic Javascript source includes in XUL Applicat...

- Interesting PHP function scoping caveat

- Implementing a Singleton Design pattern in PHP

- Unicode Rendering in Firefox is broken.

- Questions for the Campers at BarCampMumbai2

- GTAC 2007, Selenium, and the UI as objects in test...

- Installing Xdebug for PHP on Centos 4 (server)

- Learning Javascript the right way.

Archives

- August 2007
- October 2007
- January 2008
- February 2008
- March 2008

My choice of links
worth visiting

Check out

- BookEazy
- Intermission
- Sukshma
- CodeWord
- TechCrunch

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]

Hi. You've reached Nigel.in

This site is still in its very early stages, but what you have landed on, possibly inadvertently, is the website of a certain curious character a.k.a Nigel Fernandes

The aim of this page was to serve as a landing point for those of you who want to know a little more about me. The links on the right and left will take you deeper my world, or possibly on to different exciting things.

Its a big web out there and this is just one more street for you to saunter down. I hope you like it.

Close this.

My Photo
Name:
Location: Panjim, Goa, India

Crazy, dancing, programming, Goan.. I'm a computer geek and proud to be one. I program in Java, Ruby and .Net, PHP, Javascript. A lot of my recent work has been about CSS and UI design practices for large scale websites and Agile teams. I still while away hours dreaming up a web startup.

 

Installing Xdebug for PHP on Centos 4 (server)

Friday, August 24, 2007

I needed a good debugging tool for PHP 5, and decided to jump into the world of live debugging. Turns out, in the case of PHP thats not such a hot place to be in. But thats a tale for another day.

After scanning the possible offerings, I narrowed it down to the two main options.
Since Xdebug was open sourced and supported a pretty nice feature list, it was promptly selected.

So then I had to go about getting installed and setup on a Centos 4 based test environment. After some searching I still hadn't found the exact instructions.

So for those of you who need to install Xdebug, here is what you need to do.
  1. You need to have PHP 5 and PECL installed and working with Apache already.
  2. You need to install PHP's devel package. This is needed for the command phpize to work. Note that you need to have the CentosPlus repository enabled for this. So from the terminal as root run the command:
    yum install php-devel
  3. Next you need to have GCC and GCC C++ compilers installed. The only way to install Xdebug on linux as of time of writing this is to compile the extension yourself. The good thing is that this turns out to be is really easy. Note that you also need Autoconf and Automake packages. Once again from the terminal as root run the command:
    yum install gcc gcc-c++ autoconf automake
  4. Next its time to get the Xdebug package for php itself, and compile and install it. That is as simple as typing the following command as root:
    pecl install Xdebug
  5. Now you need to configure your PHP to load the extension. On Centos, extensions are loaded from a folder most likely to be located at /etc/php.d In this folder you are most likely a bunch of .ini files corresponding to what ever extensions you have installed for use with PHP. You now need to create a file called xdebug.ini here as root. Next add the following lines to the file:
    ; Enable Xdebug extension module
    extension=xdebug.so

    ; Configure the extension [See Xdebug documentation for options to add here]
    xdebug.remote_enable=
    xdebug. .....
  6. Restart Apache with service httpd restart and check the output of phpinfo() to see the if Xdebug is loaded and configured correctly.

In case anybody was wondering where the xdebug.so lives on Centos well my system has it sitting at /usr/lib/php/modules/xdebug.so Doing a simple locate xdebug.so should help you locate it.

Anyways this should be enough to get you up and debugging. I still don't have a satisfactory visual client for Xdebug on Linux, but I shall be experimenting with Eclipse's PDT client over the next few days. Will post later on that.

Labels:


 

Learning Javascript the right way.

Monday, August 13, 2007

I think everyone's first experience with JavaScript is pretty much similar. You probably got some small code snippet from somewhere, or wrote a couple of lines of code, put it into a page, and popped open IE, ...just to see what it could do.

From then on my guess is that most of you, like me, just went along writing JavaScript code, as and when fancy took us.

Can you possibly imagine doing the same thing in C ? or even Java for that matter. Of course not, because those are serious languages. Thats what I thought until I came across YUI and the amazing Douglas Crockford at the YUI theatre.

Soon after being totally brainwashed by Crockford and his lectures, I decided it was time for me to really learn JavaScript. After all programming is a serious business and for serious people right?

No sooner had I begun to look deeper into JavaScript when I found so many thing I was doing wrong when it came to this amazingly powerful and expressive language. For most part I was ignorant of JavaScript's prototypal inheritance and closures. Heck I had not even heard of JavaScript best practices.

So the week when I'm Goa, on well earned R&R, I'm going to sink myself into the world of proper JavaScript.

Labels: