TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
These forums are read-only and for archival purposes only!
Please join our new forums at discourse.kohanaframework.org
Kohana 3.2 and PHP 5.5
  • Hi,

    My little project working with Kohana 3.2.x and PHP 5.4.x fine (on centOS 6). Now I change database type from mysql to mysqli with this extension: https://github.com/Azuka/Kohana-Database-MySQLi

    Kohana 3.2.x working good with this mysqli extension.

    Now I upgrade to PHP 5.5.5 and get this error with connect to database:

    [message:protected] => mysqli::mysqli(): (HY000/2002): No such file or directory
    
    [hostname] => localhost (I have tried 127.0.0.1 too)
    [port] => 3306
    [socket] => 
    

    PHP.INI

    [MySQL]
    ; Allow accessing, from PHP's perspective, local files with LOAD DATA statements
    ; http://php.net/mysql.allow_local_infile
    mysql.allow_local_infile = On
    
    ; Allow or prevent persistent links.
    ; http://php.net/mysql.allow-persistent
    mysql.allow_persistent = On
    
    ; If mysqlnd is used: Number of cache slots for the internal result set cache
    ; http://php.net/mysql.cache_size
    mysql.cache_size = 2000
    
    ; Maximum number of persistent links.  -1 means no limit.
    ; http://php.net/mysql.max-persistent
    mysql.max_persistent = -1
    
    ; Maximum number of links (persistent + non-persistent).  -1 means no limit.
    ; http://php.net/mysql.max-links
    mysql.max_links = -1
    
    ; Default port number for mysql_connect().  If unset, mysql_connect() will use
    ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
    ; compile-time value defined MYSQL_PORT (in that order).  Win32 will only look
    ; at MYSQL_PORT.
    ; http://php.net/mysql.default-port
    mysql.default_port =
    
    ; Default socket name for local MySQL connects.  If empty, uses the built-in
    ; MySQL defaults.
    ; http://php.net/mysql.default-socket
    mysql.default_socket =
    
    ; Default host for mysql_connect() (doesn't apply in safe mode).
    ; http://php.net/mysql.default-host
    mysql.default_host =
    
    ; Default user for mysql_connect() (doesn't apply in safe mode).
    ; http://php.net/mysql.default-user
    mysql.default_user =
    
    ; Default password for mysql_connect() (doesn't apply in safe mode).
    ; Note that this is generally a *bad* idea to store passwords in this file.
    ; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password")
    ; and reveal this password!  And of course, any users with read access to this
    ; file will be able to reveal the password as well.
    ; http://php.net/mysql.default-password
    mysql.default_password =
    
    ; Maximum time (in seconds) for connect timeout. -1 means no limit
    ; http://php.net/mysql.connect-timeout
    mysql.connect_timeout = 60
    
    ; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
    ; SQL-Errors will be displayed.
    ; http://php.net/mysql.trace-mode
    mysql.trace_mode = Off
    
    [MySQLi]
    
    ; Maximum number of persistent links.  -1 means no limit.
    ; http://php.net/mysqli.max-persistent
    mysqli.max_persistent = -1
    
    ; Allow accessing, from PHP's perspective, local files with LOAD DATA statements
    ; http://php.net/mysqli.allow_local_infile
    ;mysqli.allow_local_infile = On
    
    ; Allow or prevent persistent links.
    ; http://php.net/mysqli.allow-persistent
    mysqli.allow_persistent = On
    
    ; Maximum number of links.  -1 means no limit.
    ; http://php.net/mysqli.max-links
    mysqli.max_links = -1
    
    ; If mysqlnd is used: Number of cache slots for the internal result set cache
    ; http://php.net/mysqli.cache_size
    mysqli.cache_size = 2000
    
    ; Default port number for mysqli_connect().  If unset, mysqli_connect() will use
    ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
    ; compile-time value defined MYSQL_PORT (in that order).  Win32 will only look
    ; at MYSQL_PORT.
    ; http://php.net/mysqli.default-port
    mysqli.default_port = 3306
    
    ; Default socket name for local MySQL connects.  If empty, uses the built-in
    ; MySQL defaults.
    ; http://php.net/mysqli.default-socket
    mysqli.default_socket =
    
    ; Default host for mysql_connect() (doesn't apply in safe mode).
    ; http://php.net/mysqli.default-host
    mysqli.default_host =
    
    ; Default user for mysql_connect() (doesn't apply in safe mode).
    ; http://php.net/mysqli.default-user
    mysqli.default_user =
    
    ; Default password for mysqli_connect() (doesn't apply in safe mode).
    ; Note that this is generally a *bad* idea to store passwords in this file.
    ; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw")
    ; and reveal this password!  And of course, any users with read access to this
    ; file will be able to reveal the password as well.
    ; http://php.net/mysqli.default-pw
    mysqli.default_pw =
    
    ; Allow or prevent reconnect
    mysqli.reconnect = Off
    
    [mysqlnd]
    ; Enable / Disable collection of general statistics by mysqlnd which can be
    ; used to tune and monitor MySQL operations.
    ; http://php.net/mysqlnd.collect_statistics
    mysqlnd.collect_statistics = On
    
    ; Enable / Disable collection of memory usage statistics by mysqlnd which can be
    ; used to tune and monitor MySQL operations.
    ; http://php.net/mysqlnd.collect_memory_statistics
    mysqlnd.collect_memory_statistics = Off
    
    ; Size of a pre-allocated buffer used when sending commands to MySQL in bytes.
    ; http://php.net/mysqlnd.net_cmd_buffer_size
    ;mysqlnd.net_cmd_buffer_size = 2048
    
    ; Size of a pre-allocated buffer used for reading data sent by the server in
    ; bytes.
    ; http://php.net/mysqlnd.net_read_buffer_size
    ;mysqlnd.net_read_buffer_size = 32768
    
    netstat -a | grep mysql
    unix  2      [ ACC ]     STREAM     LISTENING     46525  /var/lib/mysql/mysql.sock
    

    phpinfo()

    Client API library version:     mysqlnd 5.0.11-dev - 20120503 - $Id: 40933630edef551dfaca71298a83fad8d03d62d4 $
    Active Persistent Links:    0
    Inactive Persistent Links:  0
    Active Links:   0 
    

    Can anybody help me here?

  • Mhh, this working /modules/database/classes/kohana/database/mysqli.php:

    Find:

    $this->_connection = new mysqli($hostname, $username, $password, $database, $port, $socket);
    

    Replace with:

    $this->_connection = new mysqli($hostname, $username, $password, $database, $port, '/var/lib/mysql/mysql.sock');
    

    Or set in php.ini socket value.

  • Hi,

    The mysqli driver in Gleez CMS working well with php5.5. Gleez CMS works on php 5.3, 5.4, 5.5. Please check the drivers if you need. https://github.com/gleez/cms

Howdy, Stranger!

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

In this Discussion