hmm.. the first thing that i want to do with this box, is to do some PHP coding, and debugging. To accomplish this one could just do
to install LAMP(Linux, Apache, MySql, PHP), and there you have it, simple huh? i remember doing this in slackware few years back ^^. next just start the apache, and mysql services by doing$ sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server
you might want to change default root password for mysql database by$ sudo /etc/init.d/apache2 start
$ sudo /etc/init.d/mysql start
now debugging part, I've been using xdebug for the last year, before that I used DBG, my personal opinion, xDebug felt better, cause its free and opensource. but before we can debug our code, we have to install it first by downloading the source for linux(in windows box, I've use the precompiled binary one) from hereTo install and configure xdebug for our local server is straight forward, I'll try to brief it here(you could see the README file in the tgz file for complete how-to)$ mysqladmin -u root password newpasswd
- unpack the tarball, and cd to it
- run phpize ( if you have install php with apt-get this shouldn't be a problem) to generate configure script
- run ./configure, next run make, and there you have it, xdebug.so on modules directory
- then open /etc/php5/apache2/php.ini, using your fav editor
- add the line
zend_extension="/wherever/you/put/it/xdebug.so"
- restart apache with
$ sudo /etc/init.d/apache2 restart
- xdebug, should be loaded, you can check using phpinfo()on your page script, and search the XDebug section on that page
the problem is, i didnt use ubuntu's LAMP :), I'm using XAMPP for Linux, formerly known as LAMPP, why ? because they have it all here, PHP4, PHP5, LAMP, ProFTPD, and PHPMyAdmin, sweet! just install it and you'll have the whole family with you.
Then why is it, using XAMPP for linux than Ubuntu's LAMP would be slight a problem? because if you only download the xampp default package, you cant compile xdebug o.O !!. To compile xdebug you need the XAMPP source (development package), so here's another brief way to install XAMPP and xDebug on ubuntu
- Download XAMPP for linux, and XAMPP development package from here
- Untar both tarball into /opt/ directory with (this is a must)
and you'll have /opt/lampp/ directory$ tar -xzvf xampp-linux-1.6.6.tar.gz -C /opt
$ tar -xzvf xampp-linux-devel-1.6.6.tar.gz -C /opt - at this point you already have local server setup, you can check whether its working or not by
$ /opt/lampp/lampp start
- unpack xDebug tarball, and cd to it(wherever you unpack it doesnt matter)
- run XAMPP's phpize to generate configure script(there's a slight different here)
#pick one
$ /opt/lampp/bin/phpize-5.2.5 #if you use php 5
$ /opt/lampp/bin/phpize-4.4.8 #if you use php 4 - run
and there you have it xdebug.so on /opt/lampp/modules directory, remember!, if you try to build xdebug package without aqquiring XAMPP development package, you'll stumble with some error that said missing this, missing that, etc..$ ./configure --with-php-config=/opt/lampp/bin/php-config
$ make - then open /opt/lampp/etc/php.ini, using your fav editor
- add the line
zend_extension="/wherever/you/put/it/xdebug.so"
- next start your server, just like step #3
- done :)
have a nice day.. :)
6 comments:
which is better ?? xampp package or pure sources of apache ??
in my experience, pure sources provide more flexibility, you can choose only the module that you need, and compile it, which make the server run faster
but more flexibility is more confusing
heeehehehehhehee
like lovin someone,
wew
hmm...
yes, in most of production server, optimize native server(self compiled and configured) is preferred,
but in development environment, for me XAMPP still the most convinient way. You can switch php engine to use, administer database, etc effortless, while concentrate on application development..
and bout lovin someone, hihihi not much to say is it :p
If it is any help to anyone. I had to add a "make" step after the configure as described at http://xdebug.org/docs/install
hi, eric
maybe I didnt make myself clear enough, anyway thx for pointing it out
Thanks for the post. It helpful.
Anyway I must use
./configure --with-php-config=/opt/lampp/bin/php-config
not just
./configure
hi william, yep think I've also use that option too and forgot to wrote it argh... thx for remind me though :D
Post a Comment