upgrading to php 5.3 via macports

so i noticed macports already has php 5.3 only a week after its release. so why not give it a try. well here’s what happened ….


Zend Debugger requires Zend Engine API version 220060519.
The Zend Engine API version 220090626 which is installed, is newer.
Contact Zend Technologies at http://www.zend.com/ for a later version of Zend Debugger.

PHP Warning:  PHP Startup: apc: Unable to initialize module
Module compiled with module API=20060613
PHP    compiled with module API=20090626
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: imagick: Unable to initialize module
Module compiled with module API=20060613
PHP    compiled with module API=20090626
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/opt/local/lib/php/extensions/no-debug-non-zts-20060613/memcache.so' - dlopen(/opt/local/lib/php/extensions/no-debug-non-zts-20060613/memcache.so, 9): image not found in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/opt/local/lib/php/extensions/no-debug-non-zts-20060613/syck.so' - dlopen(/opt/local/lib/php/extensions/no-debug-non-zts-20060613/syck.so, 9): image not found in Unknown on line 0

looks like we have to upgrade or disable some extensions …

apc, imagick, memcache, syck

ok looking back at the port upgrade output actually just noticed php.ini is changed alot in this release … better use a newer copy …


--->  Uninstalling php5 @5.2.10_1+apache2+imap+ipc+macosx+mysql5+pear+sockets+sqlite+tidy
--->  Installing php5 @5.3.0_0+apache2+imap+ipc+macosx+mysql5+pear+sockets+sqlite+tidy
--->  Activating php5 @5.3.0_0+apache2+imap+ipc+macosx+mysql5+pear+sockets+sqlite+tidy
You may need to update your php.ini for any changes that have been made
in this version of php. Compare /opt/local/etc/php5/php.ini with
/opt/local/etc/php5/php.ini-development (if this is a development server) or
/opt/local/etc/php5/php.ini-production (if this is a production server).

If this is your first install, you need to activate PHP in your web server.

To enable PHP in Apache, run
  cd /opt/local/apache2/modules
  /opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so

ok so after backing up current php.ini and then copying the php.ini-development over top php.ini things seem fine.

i had a few issues with imagick and apc since they were installed from pecl and not macports but after removing and reinstalling through macports the problems were solved.

everything appears to be running smoothly.

ant + phpunit + selenium + cruisecontrol + phpundercontrol = end to end testing zen

playing with ant + phpunit + selenium (ide/core/rc) + cruisecontrol + phpundercontrol + capistrano = end to end testing plus continuous integration zen.

lets break it down …

automate builds = ant

testing end to end = phpunit + selenium

self documenting code = phpdoc + uml … (markdown + yaml)?

continuous integration = cruisecontrol + phpundercontrol

automated deploys = capistrano

——

refs:

using this article as a starting point.

http://devzone.zend.com/article/2242-Acceptance-Testing-of-Web-Applications-with-PHP

see also

http://www.phpunit.de/

http://seleniumhq.org/

http://www.phpdoc.org/

http://ant.apache.org/

http://cruisecontrol.sourceforge.net/

http://www.phpundercontrol.org/

http://www.capify.org/

* export git -> svn

* automate build / testing / end to end / continuous integration / automated deploys
ant + phpunit + selenium (rc) + cruisecontrol + phpundercontrol + capistrano = :)

more links ….

http://qualityassuranceinphpprojects.com/archives/13-Continuous-Integration-with-phpUnderControl.html

http://cruisecontrol.sourceforge.net/main/configxml.html

http://phpundercontrol.org/documentation/faq.html

http://www.maxhorvath.com/2008/08/making-phpundercontrol-cruisecontrol-accessible-via-a-proxy.html

http://jira.public.thoughtworks.org/browse/CC-541

http://felix.phpbelgium.be/blog/2009/02/07/setting-up-phpundercontrol/

http://manuel-pichler.de/categories/10-phpundercontrol

http://no-names.biz/2008/06/09/cruisecontrol-and-phpundercontrol-in-debian-etch/

git + svn

git and svn make a pretty cool combo.

its probably best to start with svn and then create a git to track it , but sometimes its more natural the other way around.

suppose you start a small local project and want to track revs, git is perfect for this as there almost no setup overhead. but when it comes time to distribute / share there are a few things to do to get it up to svn and talking back and forth.

set up the svn repo for sharing the project to, stick with the svn standard layout.


    $ svn mkdir -p svn://repo.example.com/foo/trunk svn://repo.example.com/foo/branches svn://repo.example.com/foo/tags

need to tell git about the remote and start a branch to track from … then we need to


    $ git svn clone svn://repo.example.com/foo -s .

this should get the svn standard layout into git branches. but wait we can’t sync yet, in git we’ve probably been working on the branch master and now we have an empty branch trunk that is synced with svn. so we have to switch our brach to trunk then merge our changes from master to trunk.


   $ git branch
   $ git branch trunk
   $ git merge master

now we will lose our history up to this point but from now on all git commits will equal svn commits once we issue the dcommit command. (there might be some way around this, i couldn’t figure it out, probably not a big deal since its small project getting started.)

 
   $ git svn dcommit 

you may also need to rebase since the svn version is new (although empty) than the master content.
weee! your code should now be accessible from svn check out normally


    $ svn co svn://repo.example.com/foo/trunk foo

had you started with a svn repo and wanted to do some local work using git to talk back and forth this would be much easier …. just follow this post http://tsunanet.blogspot.com/2007/07/learning-git-svn-in-5min.html

installing drizzle db on os x

UPDATE: these instruction might not be good to follow for now since even though it compiled and installed things are not happy at the moment.

$ /opt/local/bin/client/drizzletest
drizzletest: Could not open connection 'default' after 500 attempts: 21 drizzle_state_connect:could not connect
not ok

also there is better info here maybe … should have done more research fist before diving in head first i guess … oh well only way to learn is the hard way :-/

so i felt like installing drizzle the other day to check it out which as you might know is currently being developed by some people from mysql as a modern web savy simple open database …
here’s what i did to get it working … YMMV

looking at their page it seems deceptivly simple , but you may need a few key ingredients first.

if u don’t want the whole story, jump to the bottom for the short story , quick install …

ok so a quick search on macports turns up nothing …

$ port search drizzle

so it looks like we have to build ourselves but we can still use ports for deps

but we start first from the instructions on the site ->

$ bzr branch lp:drizzle ; cd drizzle; ./config/autorun.sh ; ./configure && make

-bash: bzr: command not found
-bash: cd: drizzle: No such file or directory
-bash: ./config/autorun.sh: No such file or directory
-bash: ./configure: No such file or directory

ok missing bzr

$ port search bzr
...
bzr @1.13.1 (devel, python)
The next-generation distributed version control system

btw, you want bzr not bazaar

$ sudo port install bzr

ok now to try their cmd again …

$ bzr branch lp:drizzle ; cd drizzle; ./config/autorun.sh ; ./configure && make
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data.  See "bzr help launchpad-login".
Branched 998 revision(s).

....

checking for libprotobuf... no
configure: error: protobuf is required for Drizzle. On Debian this can be found in libprotobuf-dev. On RedHat this can be found in protobuf-devel.

so we got a bit of a problem again … but at least we have the src downloaded
now and a clue to the build problems at hand. so again we turn to macports.

$ port search protobuf
...
protobuf-c @0.6 (devel)
Pure C code generator and runtime libraries for Protocol Buffers

now we install protobuf-c which also gets protobuf-cpp , these are google protocol buffers.

$ sudo port install protobuf-c

ok so now we should just need to run the last half of the original cmds without fetching the bzr src again.

$ ./config/autorun.sh ; ./configure && make
...
checking for libprotobuf... no
configure: error: protobuf is required for Drizzle. On Debian this can be found in libprotobuf-dev. On RedHat this can be found in protobuf-devel.

still a damn protobuf error … hmm quick google search with the handy grease monkey script and i have the answer. it doesn’t know where to look for protobuf so we just have to tell it.

$ ./config/autorun.sh ; ./configure --with-libprotbuf-prefix=/opt/local && make

didn’t quite work so we check the config help.

$ ./configure --help

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.
...

^^ thats good to know

—with-libprotobuf-prefix[=DIR] search for libprotobuf in DIR/include and DIR/lib

hmm so that should work, lets copy and paste to make sure we got it right and double check the path.

$ ./configure --with-libprotobuf-prefix=/opt/local/

ya that fixes protobuf but now we have another problem ..

checking for libdrizzle... no
configure: error: libdrizzle is required for Drizzle

WTF??? ok its got to be somewhere …

$ locate libdrizzle
$ sudo find / -iname *libdrizzle*
/Users/pjkix/src/drizzle/plugin/oldlibdrizzle
/Users/pjkix/src/drizzle/plugin/oldlibdrizzle/libdrizzle.cc
/Users/pjkix/src/drizzle/plugin/oldlibdrizzle/libdrizzle.h
/Users/pjkix/src/drizzle/plugin/oldlibdrizzle/libdrizzle_priv.cc
/Users/pjkix/src/drizzle/plugin/oldlibdrizzle/libdrizzle_priv.h
/Users/pjkix/src/drizzle/plugin/oldlibdrizzle/oldlibdrizzle.cc
/Users/pjkix/src/drizzle/plugin/oldlibdrizzle/oldlibdrizzle.h

now i’m kinda stumped … turns out libdrizzle is seperate from drizzle … kinda odd since mysql src builds lib and client at the same time
as it turns out there are quite a few drizzle related projects as well.

ok so now on to building libdrizzle. least we didn’t install bzr for nothing

$ cd ..
$ bzr branch lp:libdrizzle
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data.  See "bzr help launchpad-login".
Branched 87 revision(s).
PJKix-Laptop:src pjkix$ cd libdrizzle
PJKix-Laptop:libdrizzle pjkix$ ./config/autorun.sh

---
Configuration summary for libdrizzle version 0.2.0

   * Installation prefix:       /usr/local
   * System type:
   * Host CPU:                  i386
   * C Compiler:                i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5484)
   * Assertions enabled:        yes
   * Debug enabled:             no
   * Profiling enabled:         no
   * Coverage enabled:          no
   * Warnings as failure:       yes

---

$ make && sudo make install ;

----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
     during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

probably should have installed that in /opt oh well …
ok finally now back to install drizzle ….

PJKix-Laptop:libdrizzle pjkix$ cd ..
PJKix-Laptop:src pjkix$ cd drizzle/

PJKix-Laptop:drizzle pjkix$ ./configure --with-libprotobuf-prefix=/opt/local/ ; make && sudo make install
...
checking for libpcre... no
configure: error: libpcre is required for Drizzle. On Debian this can be found in libpcre3-dev. On RedHat this can be found in pcre-devel.
make: *** No targets specified and no makefile found.  Stop.

ungh more errors … its never simple eh? ok lets take care of pcre now.

PJKix-Laptop:drizzle pjkix$ port search pcre
...
pcre @7.8 (devel)
    Perl Compatible Regular Expressions Library
...

PJKix-Laptop:drizzle pjkix$ sudo port install pcre;

good that was easy.

PJKix-Laptop:drizzle pjkix$ ./configure --help

—with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib

just to be sure no more unfound libs we switch to lib path instead to take care of all libs

PJKix-Laptop:drizzle pjkix$ ./configure --with-lib-prefix=/opt/local --prefix=/opt/local ; make && sudo make install
...
---
Configuration summary for drizzle version 2009.04.998

   * Installation prefix:       /opt/local
   * System type:               apple-darwin9.6.0
   * Host CPU:                  i386
   * C Compiler:                i686-apple-darwin9-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5564)
   * C++ Compiler:              i686-apple-darwin9-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5564)
   * Build auth_pam:            no
   * Assertions enabled:        yes
   * Debug enabled:             no
   * Profiling enabled:         no
   * Coverage enabled:          no
   * Warnings as failure:       yes
   * Scheduling Plugins:        single_thread pool_of_threads
   * C++ cstdint location:      <stdint.h>
   * C++ hash_map location:     <ext/hash_map>
   * C++ hash namespace:        __gnu_cxx
   * C++ shared_ptr namespace:  std::tr1

---
...
----------------------------------------------------------------------
Libraries have been installed in:
   /opt/local/lib/drizzle/plugin

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
     during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

so after much bubbling & churning we have …
the last piece of the puzzle … SUCCESS!

$ drizzled
drizzled         drizzled_safe    drizzledumpslow
PJKix-Laptop:drizzle pjkix$ drizzled --version
drizzled  Ver 2009.04.998 for apple-darwin9.6.0 on i386 (Source distribution)

Quick Intstall

easy way would probably be to follow these steps. hopefully you are already using the awesome macports and have xcode tools installed.

$ sudo port install bzr protobuf-c pcre
$ cd src
$ bzr branch lp:libdrizzle
$ cd libdrizzle
$ ./configure --prefix=/opt/local && make && sudo make install
$ cd ..
$ bzr branch lp:drizzle
$ cd drizzle
$ ./config/autorun.sh
$ ./configure --with-lib-prefix=/opt/local --prefix=/opt/local &&  make && sudo make install

have fun playing with drizzle :)

LOL :) —disable-fail Turn warnings into failures [default=on]

git gotchas, migrating from svn

so i’ve been playing around with git lately as a replacement for subversion (svn) since the 1.5 merge tracking isn’t all that great anyway and most package managers are frozen at 1.4 for a while. basically i’m too lazy to upgrade fedora box with svn/trac by hand, plus official packages are easier to maintain IMHO.

switching to git, after getting your head around the whole distributed nature of git and its flexible workflows not to mention its sometimes quirky syntax (re-adding a file to update it?). there’s a few things i find lacking …

these are some major buzz kills for me, but maybe not that bad. there are a few workarounds but some aren’t very pretty.

one nice thing is the ability to sorta mix and match using a hybrid of svn + git for the best of both worlds.

you can do a git check out of an svn project and sync both ways while levering a local repo with full history and offline commits plus unlimited branches just like the way git normally rolls.

some caveats with the distributed nature of git its hard to tell what state your repo is in. is it up to date? are all local changes published publicly? do you have everyone elses changes? raises some interesting questions anyway maybe i’m not getting it or shouldn’t worry and let it git me instead :-/

after playing with mercurial for a few minutes it seems there are issues here as well :(

but also some cool features, like built in http server for repo browsing. plus more convential named commands.

more i read the list of subversion alternatives is getting longer … even one based on svn called svk

to be continued …

mac os x leopard unix groups admin

well it looks like there is still no usermod command in leopard and they have gotten rid of the god awful netinfo manager

the new commands use dscl (directory services client) for managing users and groups. its still a bit confusing and less straight forward than the normal unix commands , usermod, groupadd, etc. 

list groups


dscl . -list /groups 

read group


dscl . -list /groups/_www

add users

dscl . -merge /groups/_www users pjkix

MacPorts gotchas: staging ncurses, running mysql5 – The Pug Automatic

More mac port upgrade gotchas … sudo port -fun upgrade outdated ;)

MacPorts gotchas: staging ncurses, running mysql5 – The Pug Automatic

new bond movie rant

Quantum of Solace … good action movie, bad bond movie. where do i begin? the beginning i guess …

  • Bond girl silhouettes severely lacking from opening. music is sub-par
  • did not follow formula of bond being pulled off one mission for another
  • M is called “Mum” now?
  • No Q, no gadgets :(
  • No Money Penny
  • WTF with the lame felix lighter
  • no Specter , some new Q? quantum
  • no evil genius, diabolic scheme is to make people thirsty in bolivia ? ROFL
  • where are the henchmen even?
  • oil covered chick homage to gold finger was a nice gesture but seemed out of place.
  • every vehicle he got in became super no matter how shitty it was.
    • the crappy wood boat that outran and overrun speed boats!
    • the  giant cargo plane that was traded for an van instead of the nice light 2 man plane right there. the cargo plane managed to out maneuver a dog fighter and crash it into a mountain! LOL.
  • no getting the girl at the end
  • (many other bondish features missing)

    guess they don’t make em like they used to … i’m done for now

    xbox live back online

    finally after 2 years in collections my xbox live account is back online … weee! let the games begin!

    running ie8 beta 2 on ubuntu

    so after looking over this post … http://mapopa.blogspot.com/2008/06/running-ie6-ie7-and-ie8-on-your-ubuntu.html

    i’ve decided to take the plunge and try it out …

    no luck getting it to run with parallels, since it prompts for a windows xp sp3 cd that i don’t have …

    trying to get it running under ubuntu with virtual box since vmware server isn’t free …

    see also …

    http://blog.mozmonkey.com/2008/vpc-ie6-ie7-ie8-on-mac-os-x/

    http://www.vmware.com/download/

    http://www.virtualbox.org/wiki/Linux_Downloads

    http://phorolinux.com/installing-virtualbox-ose-on-ubuntu-710-gutsy-gibbon.html

    http://bellard.org/qemu/