Product:
Search Type:

[Info] Sitebuilder fails to publish because of missing SQLite 2.x support.

Article ID: 5460 
Last Review: Jul,17 2008
APPLIES TO:
  • Sitebuilder 3.x for Linux/Unix
  • Sitebuilder 4.x for Linux/Unix

SYMPTOMS

The site cannot be published to the specified location.
The specified site location does not support modules data storage. SQLite version 2.x must be installed at the target server. Please contact the server administrator.

CAUSE

There is a special requirements list for publishing server exists - http://www.parallels.com/en/products/sitebuilder/reqs
This list includes sqlite (2.x, support UTF-8 encoding) support for PHP. If publishing side does not have appropriate SQLite 2.x extension installed for PHP you will get error message during publication.

RESOLUTION

There should be sqlite2 libraries itself installed on the server with appropriate sqlite 2.x UTF-8 encoding support.
SQLite libraries package can be installed on the server directly using system automated update program. For example, with help of 'yum':

# yum install sqlite2

 or it can be found on one of the RPM resources, as http://rpm.pbone.net or http://rpmfind.net/

As for sqlite 2.x UTF-8 encoding support for PHP  appropriate php-sqlite package which includes necessary sqlite.so extension should be installed on the server. You can try to install it with help of 'yum' or 'apt-get' (on Debian and Ubuntu servers). For example, for php5:

 # yum install php-sqlite
 # apt-get install php5-sqlite (on Ubuntu and Debian servers)

If no suitable packages found extension can be also compiled from the SQLite sources. You can find some instuctions how to compile sqlite.so with UTF-8 encoding support below:

Note, following packages should be installed for this operation: tar, php, php-devel

These are just general instructions and they can differ depending on OS installation and configuration.

Step by step instructions are listed below:

  1. Download source package. You can get it from here: http://pecl.php.net/package/SQLite

    # wget http://pecl.php.net/get/SQLite-1.0.3.tgz
    or
    # pear download sqlite

  2. Unpack SQLite-1.0.3.tgz to SQLite-1.0.3 directory:

    # tar -xzf SQLite-1.0.3.tgz

  3. Move into SQLite-1.0.3 directory

    # cd SQLite-1.0.3

  4. You need to have UTF-8 encoding support for sqlite.so extension, so following modification should be done:

    edit SQLite-1.0.3/libsqlite/src/main.c file and change this section

    #ifdef SQLITE_UTF8
    const char sqlite_encoding[] = "UTF-8";
    #else
    const char sqlite_encoding[] = "iso8859";
    #endif

    to

    //#ifdef SQLITE_UTF8
    const char sqlite_encoding[] = "UTF-8";
    //#else
    //const char sqlite_encoding[] = "iso8859";
    //#endif

    comment all strings excluding one with UTF-8 encoding.

  5. Find phpize binary file and run it. Location for this file can be different. Standard path is /usr/bin/phpize. Make sure that you are still in SQLite-1.0.3 directory and run the following command:

    # /usr/bin/phpize (path to phpize can be different)

    If there is no such file, try to find it with following commands:

    # whereis phpize
    # locate phpize|grep bin

  6. Find location for php-config file. It should be the same as for phpize file and run following commands:

    # ./configure --with-sqlite --with-php-config=/usr/bin/php-config (path to php-config can be different)
  7. Run 'make' command:

    # make

    If you meet something like that:

    "error: `BYREF_NONE' undeclared"

    you will need edit sqlite.c comment out the following line:

    /* static unsigned char arg3_force_ref[] = {3, BYREF_NONE, BYREF_NONE, BYREF_FORCE }; */

    And then change these lines

    function_entry sqlite_functions[] = {
    PHP_FE(sqlite_open, arg3_force_ref)
    PHP_FE(sqlite_popen, arg3_force_ref)


    to

    function_entry sqlite_functions[] = {
    PHP_FE(sqlite_open, third_arg_force_ref)
    PHP_FE(sqlite_popen, third_arg_force_ref)

  8. # make
  9. # make install
  10. # cp modules/sqlite.so /usr/lib/php/modules (path to modules folder can be different). Actually, 'make install' should copy the extension to appropriate place so this operation might be not required.
  11. You should create a file in /etc/php.d/ named sqlite.ini or add sqlite.so extension directly into php.ini file. Inside write this :

    ; Enable sqlite extension module
    extension=sqlite.so
  12. Restart apache service with

    # /sbin/service/httpd restart
    or
    # /etc/init.d/httpd restart

Additional information

Related articles:

Does Sitebuilder support SQLite 3.x?

Warning about UTF-8 encoding support for SQlite

Please provide feedback on this article

Did this article help you solve your issue?
Yes
No
Partially
I do not know yet
 
Strongly Agree   Strongly Disagree
  9 8 7 6 5 4 3 2 1
The article is easy to understand
The article is accurate
Additional Comments:
*Please provide us with your email address in case we need to contact you.
*Please type the code you can see.
* - required fields