Problems compiling PHP 5.3.19 on Mountain Lion

I had to add EXTRA_CFLAGS = -lstdc++ -lresolv to Makefile when trying to compile PHP 5.3.19 with:

./configure --prefix=/usr/local --mandir=/usr/share/man --infodir=/usr/share/info --sysconfdir=/private/etc --enable-cli --with-config-file-path=/usr/local/php/etc --with-libxml-dir=/usr --enable-xml --enable-exif --enable-ftp --with-gd --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib --enable-gd-native-ttf --with-imap=/usr/local --with-imap-ssl --enable-magic-quotes --enable-mbstring --enable-mbregex --enable-json --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mysql-sock=/tmp/mysql.sock --with-iodbc=/usr --enable-shmop --enable-sockets --enable-fpm --with-mhash --with-mcrypt --with-xmlrpc --enable-xmlwriter --enable-xmlreader --with-xsl=/usr --enable-zend-multibyte --enable-zip --with-pcre-regex=/usr/local --with-pdo-sqlite --enable-pdo --with-freetype-dir=/usr/local --enable-dom --enable-fileinfo --with-kerberos --with-pgsql=/Applications/Postgres.app/Contents/MacOS --with-pdo-pgsql=/Applications/Postgres.app/Contents/MacOS --with-curl --with-gettext --with-zlib --with-tidy --enable-pcntl --enable-hash --enable-mbregex --with-regex=php --enable-bcmath --enable-sqlite-utf8 --enable-intl

Otherwise I had errors with Intl (ICU) and cUrl together, something like :

Undefined symbols for architecture x86_64
_res_9_dn_expand etc...

This was on OSX Mountain Lion.
Coworker reports it also works on old Lion :p

Posted in mac, php | 2 Comments

Keyboard layout on Linux for people coming from Mac

Since I almost never used a PC before, I am a bit lost with the default keyboard layout. There is this annoying Windows key, the Alt key on the left is not the same as the right one, there is a Menu key, the Control key is very far on the right side. All in all, it’s not very well optimised, at least for programers.

Furthermore, I also recently learned touch-typing with a Bépo layout, so I don’t need to see the keyboard anymore, it’s all in my head.

So instead of the default layout, I reconfigured some modifiers keys like on the picture.

Here is the configuration I used in /usr/share/X11/xkb/symbols/altwin

partial modifier_keys
xkb_symbols "ctrl_alt_win" {
  key <LALT> {   [   Control_L, Control_L   ]   };
  key <RALT> {   [   Control_R, Control_R   ]   };
  key <LCTL> { type[Group1] = "ONE_LEVEL", symbols[Group1] = [ Super_L ] };
  key <MENU> {    [   Alt_L,  Meta_L      ]   };
  key <LWIN> { type[Group1]="ONE_LEVEL", symbols[Group1] = [ ISO_Level3_Shift ] };
  key <RCTL> { type[Group1]="ONE_LEVEL", symbols[Group1] = [ ISO_Level3_Shift ] };
  modifier_map Control { <LALT>, <RALT> };
  modifier_map Mod1   { <MENU> };
  modifier_map Mod5   { ISO_Level3_Shift };
};

It can probably be improved but it works.

Posted in linux | Comments Off

Twitter Bootstrap and the QuickForm2 Callback Renderer

I don’t know about you, but for me building HTML Forms and styling HTML Forms are maybe the most boring things in web development. It’s repetitive and takes a lot of time to do things correctly.

That’s why tools like Twitter’s Bootstrap and PEAR’s HTML_QuickForm2 can help with this part of our job.

Wouldn’t it be nice to have QuickForm2 generate a markup compatible with Bootstrap CSS, so that you could get a nice looking form without to much efforts? Well, that’s what I plan to do here.
Continue reading

Posted in php | Tagged , , , | 6 Comments

PHP with Intl and Gettext on OSX Lion

Mac OSX Lion ships with PHP 5.3.6. There are also other ways to get PHP working on Lion, for example:

These are all very good solutions, but since I prefer to travel light and the version in Lion already comes with a lot of useful extensions, I preferred to go with it.
Continue reading

Posted in mac, php | 6 Comments

From iPhone to Samsung Galaxy S2

Two days ago, I received my new Samsung Galaxy S2, which is a smartphone running Android. Previously, I was using an iPhone 3G but it really started to feel sluggish more and more with time. I was still using iOS 3 since I had no use for version 4 features and was afraid it would just make the phone even slower.
Continue reading

Posted in digital, life | 1 Comment

Getting started with HTML_QuickForm2

QuickForm 2 is a PHP library which makes the development of complex and modern HTML forms easier and faster. It is the natural successor of QuickForm with a new revamped API, PHP5 support, new features and less bloat. Its development was started in 2007 by Alexey Borzov and Bertrand Mansion, and we are very close to a first beta release. I already use QuickForm 2 in production on a dozen of sites and since its code is almost fully unit tested, it is very stable.
Continue reading

Posted in php | Tagged , | Comments Off