PHPExcel: read Excel from LAMP

Posted by oshua in PHP on 22. Oct, 2009 | 1 Comment

PHPExcel ( is a set of classes to read and write Excel effectively, but it is even much more than just that.

Sending form vars as a serialized PHP object with JQuery

Posted by oshua in HTML, JQuery, PHP on 30. Sep, 2009 | 1 Comment

Sometimes you want to pass only part of a form through ajax to get some results without updating the whole page. JQuery has some great functions to convert the content of a form into a serialized string or object (either serialize or serializeArray). However they both take the content of a full form as input [...]

Inserting anonymous content on a database

Posted by oshua in Mysql, PHP on 16. Sep, 2009 | No Comments

When working in a web application that needs to do a complex insert on several tables of a database sometimes you need to know the next autoincrement id from one table although this record does not exist yet. For example, let’s say you wish to allow¬†users to join to your service but while doing it [...]

Making php-ffmpeg work on latest ffmpeg version

Posted by oshua in Linux, PHP on 09. Sep, 2009 | No Comments

Every now and then upgrades on ffmpeg affects php-ffmpeg. This is happening now with php-ffmpeg 0.6.0 and latest version of ffmpeg.
To compile php-ffmpeg 0.6.0 with latest ffmpeg version successfully you will need to follow these 2 steps:
1. First issue is reported in many places on the web. On the file ffmpeg_frame.c every ocurrence of PIX_FMT_RGBA32 [...]

Configure web server on CentOS 5 in 5 minutes

Posted by oshua in General on 25. Aug, 2009 | No Comments

This is the minimum required to install and configure a web server on a CentOS 5 new installation:
1. Install php, apache and some other common libraries
yum install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel
To start apache automatically when the server starts
chkconfig –levels 235 httpd on
Restart apache
/etc/init.d/httpd [...]

4 reasons to switch to Imagick if you still use GD

Posted by oshua in PHP on 18. Aug, 2009 | No Comments

Here are some reasons why Imagick is much better than GD:
- Image quality: even after common operations like resizing results are obvious. Make a simple test, try resizing an image with more than 1000×1000 pixels with GD and then do it with Imagick. You’ll see what I am talking about.
- Class based: operations are as [...]