Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID

Can't install with the error: could not find driver

edited April 2012 in Install Help

When I install Elefantcms on the step:database, there is an error:

Connection Error:

could not find driver

SQLite users can simply click 'Connect & Create Schema'. MySQL users please select your driver and enter your server details to continue.

This error appear on my laptop and server, and the server environment is:

OS: Debian GNU/Linux 6.0.4 (squeeze)

PHP: 5.4.0

Webserver: Nginx 1.0.14

Mysql: 5.5.13

The nginx configure file is:

worker_processes 1;

events {

worker_connections  1024;

}

http {

include       mime.types;

default_type  application/octet-stream;

sendfile        on;

keepalive_timeout  65;

server {

listen 80;

server_name www.elefant.lo;

root /home/standme/webroot/elefantcms;

location / {

index index.html index.htm index.php;

try_files $uri $uri/ /index.php?$args;

}

location ~ \.php {

include fastcgi.conf;

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

}

location ^~ /conf/ {

deny all;

return 403;

}

location ~ ^/(cache|apps|tests)/.*\.(php|sql)$ {

deny all;

return 403;

}

}

}

The database information is complete right, why this error, how to solve it?

Comments

  • I guess you didn't install php sqlite extension?

  • You can also check which PHP extensions you have in two ways:

    1. On the command line, type:

      php -m

    2. Create a file in your website root folder named phpinfo.php with the following code:

      <?php phpinfo (); ?>

    Then go to /phpinfo.php and you'll see a detailed printout of settings and extensions. Just be sure to remove the file after so others don't have access to it as well.

  • edited April 2012

    Sqlite extension is already installed, I can see that in phpinfo:

    PDO PDO support enabled PDO drivers sqlite

    pdo_sqlite

    PDO Driver for SQLite 3.x enabled SQLite Library 3.7.7.1

    sqlite3

    SQLite3 support enabled SQLite3 module version 0.7 SQLite Library 3.7.7.1

    mysql

    MySQL Support enabled

    Active Persistent Links 0

    Active Links 0

    Client API version 5.5.13

    MYSQL_MODULE_TYPE external

    MYSQL_SOCKET /tmp/mysql.sock

    MYSQL_INCLUDE -I/usr/local/mysql/include

    MYSQL_LIBS -L/usr/local/mysql/lib -lmysqlclient

    Directive Local Value Master Value

    mysql.allow_local_infile On On

    mysql.allow_persistent On On

    mysql.connect_timeout 60 60

    mysql.default_host no value no value

    mysql.default_password no value no value

    mysql.default_port no value no value

    mysql.default_socket /tmp/mysql.sock /tmp/mysql.sock

    mysql.default_user no value no value

    mysql.max_links Unlimited Unlimited

    mysql.max_persistent Unlimited Unlimited

    mysql.trace_mode Off Off


    When I use the sqlite as database driver, the cms installing success. but when I use mysql, This error occurred.

    When I check the logfile, I found there is nothing in the error_log of nginx, the content of access_log is this:

    115.55.84.191 - - [18/Apr/2012:22:58:59 +0800] "GET / HTTP/1.1" 200 1185 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.163 Safari/535.19"

    115.55.84.191 - - [18/Apr/2012:22:59:01 +0800] "GET /favicon.ico HTTP/1.1" 200 52 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.163 Safari/535.19"

    115.55.84.191 - - [18/Apr/2012:23:02:00 +0800] "GET / HTTP/1.1" 302 5 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.163 Safari/535.19"

    115.55.84.191 - - [18/Apr/2012:23:02:02 +0800] "GET /install/ HTTP/1.1" 200 707 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.163 Safari/535.19"

    115.55.84.191 - - [18/Apr/2012:23:02:03 +0800] "GET /install/css/style.css HTTP/1.1" 200 691 "http://www.domain.com/install/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.163 Safari/535.19"

    115.55.84.191 - - [18/Apr/2012:23:02:09 +0800] "GET /favicon.ico HTTP/1.1" 302 5 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.163 Safari/535.19"

    115.55.84.191 - - [18/Apr/2012:23:02:10 +0800] "GET /install/ HTTP/1.1" 200 707 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.163 Safari/535.19"

    115.55.84.191 - - [18/Apr/2012:23:02:34 +0800] "GET /install/?step=license HTTP/1.1" 200 1099 "http://www.domain.com/install/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.163 Safari/535.19"

    115.55.84.191 - - [18/Apr/2012:23:02:34 +0800] "GET /favicon.ico HTTP/1.1" 302 5 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.163 Safari/535.19"

    115.55.84.191 - - [18/Apr/2012:23:02:37 +0800] "GET /install/?step=requirements HTTP/1.1" 200 420 "http://www.domain.com/install/?step=license" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.163 Safari/535.19"

    115.55.84.191 - - [18/Apr/2012:23:02:37 +0800] "GET /install/ HTTP/1.1" 200 707 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.163 Safari/535.19"

    115.55.84.191 - - [18/Apr/2012:23:02:38 +0800] "GET /favicon.ico HTTP/1.1" 302 5 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.163 Safari/535.19"

    115.55.84.191 - - [18/Apr/2012:23:02:41 +0800] "GET /install/?step=database HTTP/1.1" 200 1045 "http://www.domain.com/install/?step=requirements" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.163 Safari/535.19"

    115.55.84.191 - - [18/Apr/2012:23:02:42 +0800] "GET /install/ HTTP/1.1" 200 707 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.163 Safari/535.19"

    115.55.84.191 - - [18/Apr/2012:23:03:02 +0800] "POST /install/?step=database HTTP/1.1" 200 1111 "http://www.domain.com/install/?step=database" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.163 Safari/535.19"


    ** I guess is there something wrong with NGINX configuration file, perhaps here:

    try_files $uri $uri/ /index.php?$args;

    In the same environment except the web server, I can install successful in the apache.

  • It sounds like Apache and Nginx might be using different copies of PHP, which may have different configurations. I would double-check that not just the MySQL extension but also the MySQL PDO extension is enabled by loading a phpinfo.php file through Nginx and seeing if it reveals any clues. Hope that helps.

  • I Re-configure PHP with adding pdo-mysql extension, then Re-install elefantcms, this error occurred on the database step:

    SQLSTATE[42S02]: Base table or view not found: 1146 Table 'showlee.webpage' doesn't exist

    Is not elefantcms need to use pdo-mysql extension or ODBC extension? In that case, You should rewrite the Testing Requirements script.

    Perhaps you can set up a server environment I used to test.

    My server environment:

    Debian:6.0.4_amd64

    Nginx:1.0.14, the configure script:

    ./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/bin/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-openssl= --with-zlib= --with-http_ssl_module

    PHP:5.4.0, the configure script:

    ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql-sock=/tmp/mysql.sock --with-freetype-dir --with-jpeg-dir --with-zlib --with-curl --with-curlwrappers --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --with-libxml-dir --with-iconv-dir --with-bz2= --with-icu-dir= --with-ldap=/usr --with-ldap-sasl=/usr --with-xsl= --with-gettext --enable-mbstring --enable-exif --enable-ipv6 --enable-ftp --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-tidy --enable-wddx --with-xmlrpc --enable-zip --with-pcre-regex=/usr

    Mysql:5.5.13

  • Should definitely be PDO + MySQL (no ODBC). I'll take a look and try to compile with the same settings tomorrow and see what that turns up.

    Looking at the install script, it actually only checks for PDO currently, but I should add a check for at least one of the supported PDO drivers (and maybe only show the supported options in the database step too...).

  • hi jbroadway, do you use the server environment i said to test the installation?

  • I've just finished setting up Debian 6 on a new VM tonight. I'll try to install Nginx, PHP and MySQL tomorrow and test it out.

  • Here are the steps I took to get a custom Nginx + PHP installation going on a local virtual machine running the latest Ubuntu (will be able to try it on my Debian VM later, but was on a different machine today).

    # basics and nginx
    aptitude install build-essential vim git libpcre3-dev libssl-dev zlib1g-dev
    wget http://nginx.org/download/nginx-1.2.0.tar.gz
    tar -zxf nginx-1.2.0.tar.gz
    cd ~/nginx-1.2.0 
    ./configure --with-http_ssl_module
    make
    make install
    
    # php
    aptitude install php5-dev libxml2-dev mysql-server mysql-client
    wget http://www.php.net/get/php-5.4.1.tar.gz/from/ca.php.net/mirror
    mv mirror php-5.4.1.tar.gz
    tar -zxf php-5.4.1.tar.gz
    cd ~/php-5.4.1
    ./configure --enable-pdo --with-pdo-mysql
    
    # start it up
    vim /etc/init.d/php-fastcgi
    # add contents of the next section to the file
    chmod +x /etc/init.d/php-fastcgi
    /etc/init.d/php-fastcgi start
    vim /usr/local/nginx/conf/nginx.conf
    # uncomment the 'location ~ \.php' section but edit SCRIPT_FILENAME's
    # path to be /usr/local/nginx/html$fastcgi_script_name;
    /usr/local/nginx/sbin/nginx
    

    I put this in /etc/init.d/php-fastcgi to start it up:

    #!/bin/bash
    BIND=127.0.0.1:9000
    USER=www-data
    PHP_FCGI_CHILDREN=15
    PHP_FCGI_MAX_REQUESTS=1000
    
    PHP_CGI=/usr/local/bin/php-cgi
    PHP_CGI_NAME=`basename $PHP_CGI`
    PHP_CGI_ARGS="- USER=$USER PATH=/usr/bin PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS $PHP_CGI -b $BIND"
    RETVAL=0
    
    start() {
          echo -n "Starting PHP FastCGI: "
          start-stop-daemon --quiet --start --background --chuid "$USER" --exec /usr/bin/env -- $PHP_CGI_ARGS
          RETVAL=$?
          echo "$PHP_CGI_NAME."
    }
    stop() {
          echo -n "Stopping PHP FastCGI: "
          killall -q -w -u $USER $PHP_CGI
          RETVAL=$?
          echo "$PHP_CGI_NAME."
    }
    
    case "$1" in
        start)
          start
      ;;
        stop)
          stop
      ;;
        restart)
          stop
          start
      ;;
        *)
          echo "Usage: php-fastcgi {start|stop|restart}"
          exit 1
      ;;
    esac
    exit $RETVAL
    

    From here, I created a basic <?php phpinfo(); ?> file in the /usr/local/nginx/html folder and it outputs that PHP is running with PDO + MySQL. I'll test again on the Debian install later and also confirm Elefant runs on it too. Won't be able to until later tonight or tomorrow I'm afraid.

    One thing I didn't change but looks like I'd need to for PHP to connect to MySQL is to either edit /etc/mysql/my.cnf and set the socket file to /tmp/mysql.sock or edit the php.ini file and point it to the socket file found in /etc/mysql/my.cnf. That's often something that trips people up in getting the two to talk to each other.

    Personally though, I'd strongly consider using the OS-provided packages to install Nginx and PHP, for example:

    That way you can also update them via apt-get as well.

Sign In or Register to comment.