You'll need to enable mod_compress on lighthttpd in addition to the changes you made in your php file.
http://www.cyberciti.biz/tips/lighttpd-mod%5Fcompress-gzip-compression-tutorial.html
Edit:
I believe you're looking for an html minimizer then. If you check out the headers that google is sending back they look like this:
(Status-Line) HTTP/1.1 200 OK
Date Thu, 22 Oct 2009 18:28:47 GMT
Expires -1
Cache-Control private, max-age=0
Content-Type text/html; charset=UTF-8
Content-Encoding gzip
Server gws
Content-Length 3519
X-XSS-Protection 0
The "Content-Encoding gzip" is what you're looking for if you want to check for to see if your webserver is properly compressing your files.