I don't think it will cause a major problem for now. I was able to fix the connection problem. It has something to do with mysql.sock. Using shell, mysql looks for /var/lib/mysql/mysql.sock but using php, it's using /tmp/mysql.sock. What I did was to use ln -s /tmp/mysql.sock /var/lib/mysql/msql.sock and I am able to connect to mysql using shell and from a client browser via php.
Now my next problem is zlib. I did make a new zlib from source. And I used --with-zlib-dir=/usr/local --with-zlib among the ./configure options
But make doesn't seem to like it. It says ext/zlib/zlib.lo: file not recognized: File truncated
What's the meaning of this?