Jump to:

558 Posts in 3573 Topics by 244 members

Hosting Requirements

SilverStripe Forums » Hosting Requirements » Host-Europe SSS 2.4.0 and sqlite fails

What you need to consider when choosing a hosting provider and plan.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 2961 Views
  • gaston
    Avatar
    Community Member
    24 Posts

    Host-Europe SSS 2.4.0 and sqlite fails Link to this post

    Salut,
    I just tried to install SS 2.4.0 with sqlite on host-europe and it fails when creating the database file.
    In the initial check, it tries to write to /is/<account-subdir>/www/CMS/assets/DB successfully, but in the installation phase it fails on line 620 on the DB creation
    Using .DB is not permitted at host-europe.
    Using another location under the tree above (i.e. /is/<account-subdir>/DB) is not accepted by the install routine as well as any other subdirectory other than under /is/<account-subdir>/www/CMS/assets.
    I have tried all with chmod 777 without success
    Looks to me like an internal php code error

    Ciao, Mathias
    PS: Switching to MySQL works, so it is an issue with the write access for the sqlite db file

  • apiening
    Avatar
    Community Member
    55 Posts

    Re: Host-Europe SSS 2.4.0 and sqlite fails Link to this post

    Salut gaston,

    if you can't move the db file out of reach for browsers and you are not allowed to use foldernames preceeded by dots you might want use a regular foldername and put an .htaccess file into it containing:

    <code>
    deny from all
    </code>

    to protect your database file from unauthorised access. however read/write access to the location of the db file as well as to the file itself must be granted to the the webserver.

    line 620 of Database.php is just the command to trigger the error. can you give me the whole backtrace that comes with the error?

    Cheers

    Andy

  • gaston
    Avatar
    Community Member
    24 Posts

    Re: Host-Europe SSS 2.4.0 and sqlite fails Link to this post

    Salut Andy,
    here the complete protocol of my actions. I removed site specific information anreplaced them with xxxx. This should not have an impact on the error

    SilverStripe: 2.4.0
    sqlite: sqlite3-trunk-r106099.tar.gz
    sqlite renamed to sqlite only (removing the trunk information)
    upload to host-europe into directory SStest using filezilla 3.3.2.1, transfertyp automatic
    calling http://www.<domain>.de/SStest
    chmod 777 .htaccess in SStest
    chmod 777 assets
    chmod 777 mysite/_config.php
    selecting sqlite database
    absolute path:
    /is/htdocs/wpxxxxxxx_LAX2FF6GKA/www/SStest/assets/.db
    mkdir .db
    error message in install.php:
    That username/password doesn't work: Cannot secure path through .htaccess: "/is/htdocs/wp1137769_LAX2FF6GKA/www/SStest/assets/.db"
    copying silverstripe root .htaccess file into .db folder
    chmod 777 assets/.db/.htaccess
    chmod 777 assets/.db
    install.php now free of error or warning
    starting installation
    -----------------------------
    # Setting up 'mysite/_config.php'...
    # Setting up /is/htdocs/wpxxxxxxx_LAX2FF6GKA/www/SStest/mysite/_config.php
    # Setting up '.htaccess' file...
    # Setting up /is/htdocs/wpxxxxxxx_LAX2FF6GKA/www/SStest/.htaccess
    # Building database schema...
    [User Error] Couldn't run query: PRAGMA integrity_check | unable to open a temporary database file for storing temporary tables
    POST /SStest/install.php

    Line 620 in /is/htdocs/wpxxxxxxx_LAX2FF6GKA/www/SStest/sapphire/core/model/Database.php
    Trace

    * Couldn't run query: PRAGMA integrity_check | unable to open a temporary database file for storing temporary tables
    Line 620 of Database.php
    * SS_Database->databaseError(Couldn't run query: PRAGMA integrity_check | unable to open a temporary database file for storing temporary tables,256)
    Line 88 of SQLitePDODatabase.php
    * SQLitePDODatabase->query(PRAGMA integrity_check)
    Line 362 of SQLite3Database.php
    * SQLite3Database->checkAndRepairTable()
    Line 279 of SQLite3Database.php
    * SQLite3Database->beginSchemaUpdate()
    Line 185 of DatabaseAdmin.php
    * DatabaseAdmin->doBuild(1)
    Line 1028 of install.php
    * Installer->install(Array)
    Line 193 of install.php

    ==== phpinfo() output (extract, if you need details, let me know) =====

    PHP Version 5.2.12

    System    Linux wp102 2.6.30.2-he-xeon-64gb+4 #1 SMP Sat Aug 15 15:25:21 CEST 2009 i686
    Build Date    Feb 9 2010 13:02:09
    Server API    Apache 2.0 Handler
    Virtual Directory Support    disabled
    Configuration File (php.ini) Path    /etc/php5
    Loaded Configuration File    /etc/php5/php.ini
    Scan this dir for additional .ini files    /etc/php5/conf.d
    additional .ini files parsed    /etc/php5/conf.d/extensions.ini, /etc/php5/conf.d/extensions_plus.ini, /etc/php5/conf.d/fopen.ini, /etc/php5/conf.d/ioncube.ini, /etc/php5/conf.d/limits.ini, /etc/php5/conf.d/mysql.ini, /etc/php5/conf.d/mysqli.ini, /etc/php5/conf.d/paths.ini, /etc/php5/conf.d/pdflib.ini, /etc/php5/conf.d/session.ini, /etc/php5/conf.d/suhosin.ini, /etc/php5/conf.d/uploads.ini, /etc/php5/conf.d/zend.ini
    PHP API    20041225
    PHP Extension    20060613
    Zend Extension    220060519
    Debug Build    no
    Thread Safety    disabled
    Zend Memory Manager    enabled
    IPv6 Support    enabled
    Registered PHP Streams    https, ftps, compress.zlib, compress.bzip2, php, file, data, http, ftp, zip
    Registered Stream Socket Transports    tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
    Registered Stream Filters    zlib.*, bzip2.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, convert.iconv.*

    Suhosin logo This server is protected with the Suhosin Patch 0.9.7
    Copyright (c) 2006 Hardened-PHP Project
    allow_call_time_pass_reference   Off   Off
    allow_url_fopen   On   On
    allow_url_include   On   On
    always_populate_raw_post_data   Off   Off
    arg_separator.input   &   &
    arg_separator.output   &amp;   &amp;
    asp_tags   Off   Off
    auto_append_file   no value   no value
    auto_globals_jit   On   On
    auto_prepend_file   no value   no value
    browscap   no value   no value
    default_charset   no value   no value
    default_mimetype   text/html   text/html
    define_syslog_variables   Off   Off
    disable_classes   no value   no value
    disable_functions   no value   no value
    display_errors   On   On
    display_startup_errors   Off   Off
    doc_root   no value   no value
    docref_ext   no value   no value
    docref_root   no value   no value
    enable_dl   Off   Off
    error_append_string   no value   no value
    error_log   no value   no value
    error_prepend_string   no value   no value
    error_reporting   6135   6135
    expose_php   On   On
    extension_dir   /usr/lib/apache2/modules/php5/   /usr/lib/apache2/modules/php5/
    file_uploads   On   On
    highlight.bg   #FFFFFF   #FFFFFF
    highlight.comment   #FF9900   #FF9900
    highlight.default   #0000BB   #0000BB
    highlight.html   #000000   #000000
    highlight.keyword   #007700   #007700
    highlight.string   #DD0000   #DD0000
    html_errors   On   On
    ignore_repeated_errors   Off   Off
    ignore_repeated_source   Off   Off
    ignore_user_abort   Off   Off
    implicit_flush   Off   Off
    include_path   .:/usr/share/pear/php5   .:/usr/share/pear/php5
    log_errors   Off   Off
    log_errors_max_len   1024   1024
    magic_quotes_gpc   Off   Off
    magic_quotes_runtime   Off   Off
    magic_quotes_sybase   Off   Off
    mail.force_extra_parameters   no value   no value
    max_execution_time   30   30
    max_file_uploads   20   20
    max_input_nesting_level   64   64
    max_input_time   60   60
    memory_limit   128M   128M
    open_basedir   /is/htdocs/user_tmp/wp1137769_LAX2FF6GKA:/tmp:/dev/null:/dev/urandom:/bin:/usr:/is/default.errors:/is/htdocs/wp1137769_LAX2FF6GKA   no value
    output_buffering   no value   no value
    output_handler   no value   no value
    post_max_size   8M   8M
    precision   14   14
    realpath_cache_size   1M   1M
    realpath_cache_ttl   300   300
    register_argc_argv   On   On
    register_globals   Off   Off
    register_long_arrays   Off   Off
    report_memleaks   On   On
    report_zend_debug   On   On
    safe_mode   Off   Off
    safe_mode_exec_dir   no value   no value
    safe_mode_gid   Off   Off
    safe_mode_include_dir   no value   no value
    sendmail_from   no value   no value
    sendmail_path   /usr/sbin/sendmail -t -i    /usr/sbin/sendmail -t -i
    serialize_precision   100   100
    short_open_tag   On   On
    SMTP   localhost   localhost
    smtp_port   25   25
    sql.safe_mode   Off   Off
    suhosin.log.phpscript.is_safe   Off   Off
    track_errors   Off   Off
    unserialize_callback_func   no value   no value
    upload_max_filesize   8M   8M
    upload_tmp_dir   /is/htdocs/user_tmp/wp1137769_LAX2FF6GKA   /tmp
    user_dir   no value   no value
    variables_order   EGPCS   EGPCS
    xmlrpc_error_number   0   0
    xmlrpc_errors   Off   Off
    y2k_compliance   On   On
    zend.ze1_compatibility_mode   Off   Off

  • apiening
    Avatar
    Community Member
    55 Posts

    Re: Host-Europe SSS 2.4.0 and sqlite fails Link to this post

    Moin Mathias,

    some sqlite versions attempt to create a temporary file to store data. What version are you using? The sqlite section of your phpinfo() is missing.

    On the command line type "sqlite3" to enter sqlite cli, then try "PRAGMA temp_store;". If it is not set to 2 add the following to your mysite/_config.php

    <code>
    SQLite3Database::$default_pragma['temp_store'] = "MEMORY";
    </code>

    I had to tweak the sqlite3/_config.php for this to work so you have to update your sqlite3 module. http://open.silverstripe.org/changeset/106420/modules/sqlite3/trunk/_config.php

    BTW by convention module folders in Silverstripe should be exactly like the module name. For sqlite3 this is "sqlite3" and not "sqlite".

    Good luck

    Andy

  • gaston
    Avatar
    Community Member
    24 Posts

    Re: Host-Europe SSS 2.4.0 and sqlite fails Link to this post

    Moin, moin, (aus dem Badischen)

    I tried the changes but came to the same error, identical messages.
    However, after uploading the two _config.php files, I called the site URL http://www.<domain>.de/SStest and got the full working CMS. The sqlite db is created and available and works (I can create pages and change content)
    An attempt to rebuild the DB fails: calling http://www.<domain>.de/SStest/dev/build returns

    Building Database SS_mysite

    Creating database tables
    # SQLitePDO Version 3.3.8
    # Checking database integrity
    Website Error
    There has been an error

    The website server has not been able to respond to your request.

    phpinfo.php info on sqlite:
    pdo_sqlite
    PDO Driver for SQLite 3.x   enabled
    PECL Module version    1.0.1 $Id: pdo_sqlite.c 272374 2008-12-31 11:17:49Z sebastian $
    SQLite Library    3.3.8

    SQLite
    SQLite support   enabled
    PECL Module version    2.0-dev $Id: sqlite.c 289587 2009-10-12 19:04:00Z felipe $
    SQLite Library    2.8.17
    SQLite Encoding    UTF-8

    Directive   Local Value   Master Value
    sqlite.assoc_case   0   0

    I assume, the error may lie within the SQLite Library version 2.8.17. If that is the case, I have the problem, that this is something I cannot change

    Ciao, Mathias

  • apiening
    Avatar
    Community Member
    55 Posts

    Re: Host-Europe SSS 2.4.0 and sqlite fails Link to this post

    Moin Mathias (sacht man im Badischen auch moin? ;-)

    you got the discrete error msg. Can you try http://www.<domain>.de/SStest/dev/build?isDev=1 ? That should give you the chatty version.

    The Silverstripe SQLite adapter uses SQLite version 3 only, namely the native PHP SQLite3 class and as a failsafe - like in your case - the PDO implementation in case SQLite3 is not available (commonly PHP versions prior to 5.3).

    It looks like your SQLite just doesn't like the integrity check since everything else seems to work. You're almost there, so don't give up. Try the sledgehammer: open the sqlite3/code/SQLite3Database.php, search for the checkAndRepairTable function and add

    return true;

    as the first line of the function in order to pretend checks have been performed and everything is alright. This is for debugging only. If it fixes the issue I have to find a permanent solution.

    Forgive my guessing. Although the SQLite adapter is behaving decently and is passing all UNITtests it is quite new and has not been used in production here at SilverStripe due to the size of projects. So I'm happy to trade my support for your feedback.

    Cheers

    Andy

  • gaston
    Avatar
    Community Member
    24 Posts

    Re: Host-Europe SSS 2.4.0 and sqlite fails Link to this post

    Salut Andy,

    I recognized that the web server package I use on host-europe is Webpack 2.0 and that 3.0 is avaiolable. So I upgraded to the new package (which is free of charge with host-europe and took 1 hour to complete). I then gave it a fresh try to run Silverstripe on host-europe using the latest sqlite trunk 106420. Now the error is slightly different:

    [User Error] Couldn't run query: VACUUM | authorization denied
    POST /SStest/install.php

    Line 620 in /is/htdocs/wp1137769_LAX2FF6GKA/www/SStest/sapphire/core/model/Database.php
    Source

    611    /**
    612     * Error handler for database errors.
    613     * All database errors will call this function to report the error. It isn't a static function;
    614     * it will be called on the object itself and as such can be overridden in a subclass.
    615     * @todo hook this into a more well-structured error handling system.
    616     * @param string $msg The error message.
    617     * @param int $errorLevel The level of the error to throw.
    618     */
    619    function databaseError($msg, $errorLevel = E_USER_ERROR) {
    620       user_error($msg, $errorLevel);
    621    }
    622    
    623    /**
    624     * Enable supression of database messages.
    625     */
    626    function quiet() {

    Trace

    * Couldn't run query: VACUUM | authorization denied
    Line 620 of Database.php
    * SS_Database->databaseError(Couldn't run query: VACUUM | authorization denied,256)
    Line 88 of SQLitePDODatabase.php
    * SQLitePDODatabase->query(VACUUM)
    Line 364 of SQLite3Database.php
    * SQLite3Database->checkAndRepairTable()
    Line 279 of SQLite3Database.php
    * SQLite3Database->beginSchemaUpdate()
    Line 185 of DatabaseAdmin.php
    * DatabaseAdmin->doBuild(1)
    Line 1028 of install.php
    * Installer->install(Array)
    Line 193 of install.php


    looking at /assets/.db/SS_mysite, the file has size 0, permission 644 and owner is nobody/nobody

    I am very interested in getting this to work, so if you contact me directly, I can grant you access to the site so that you have a better view. We can then post the solution later on this threat

    Ciao, Mathias

  • apiening
    Avatar
    Community Member
    55 Posts

    Re: Host-Europe SSS 2.4.0 and sqlite fails Link to this post

    Hi Mathias,

    this last one is easy as. Your hoster doesn't allow for vacuuming. Just add:

    SQLite3Database::$vacuum = false;

    to your mysite/_config.php. That should be it.

    Cheers

    Andy

    2961 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.