Compile PHP5 MySQL extension from source on RHEL5

I spend far too long search for this each time I have to do it

  1. cd ~
  2. Download the PHP source for the version your using (php -i to get version)
  3. tar -xzf php-source.tar.gz
  4. cd php-source/ext/mysql
  5. sudo phpize ./
  6. sudo ./configure –with-zlib-dir=/usr/include –with-mysql-sock=/var/lib/mysql/mysql.sock –with-libdir=lib64 –with-mysql=/usr/bin
  7. make
  8. make install

Leave a Reply

Your email address will not be published. Required fields are marked *