CentOS 5 Call to undefined function sqlite_escape_string()

If you’re using PHP 5.2.x on RHEL/CentoOS and you received error

PHP Fatal error:  Call to undefined function sqlite_escape_string()

don’t worry. The reason for this is the missing sqlite extension which is not included in RHEL/Fedora/CentOS php packages by default.

To fix this issue, you can include it manually

wget http://museum.php.net/php5/php-5.2.XX.tar.gz
tar xzvf php-5.2.XX.tar.gz
cd php-5.2.XX/ext/sqlite/
phpize
./configure
make
make install
echo extension=sqlite.so >> /etc/php.d/sqlite.ini
service httpd restart

Replace XX with your PHP version (check the php version with “php -v”)

Leave a Reply

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