Page 2 of 3

Re: waiting for localhost

PostPosted: 08. March 2016 17:34
by gsc1ugs
Thank you in advance helping me with this problem, I have just changed db_driver from mysqli to MySQL which are both available and got this... ive hidden some credentials, this is defineatly a db driver issue but not sure what to do about it

Fatal error: Uncaught Error: Call to undefined function DB\mysql_connect() in C:\xampp\htdocs\auctioneerslive\system\library\db\mysql.php:7 Stack trace: #0 C:\xampp\htdocs\auctioneerslive\system\library\db.php(9): DB\MySQL->__construct('localhost:8000', 'g**********'', 'x**********'', 'auctioneerslive', '3306') #1 C:\xampp\htdocs\auctioneerslive\index.php(31): DB->__construct('mysql', 'localhost:8000', 'g**********', 'x**********', 'auctioneerslive', '3306') #2 {main} thrown in C:\xampp\htdocs\auctioneerslive\system\library\db\mysql.php on line 7

Re: waiting for localhost

PostPosted: 08. March 2016 17:48
by Altrea
gsc1ugs wrote:What program you recommend to debug php? I could at least get to the line where it hangs

You already know the line:
[Tue Mar 08 15:17:24.594050 2016] [:error] [pid 7888:tid 1612] [client ::1:50388] PHP Warning: mysqli::__construct(): MySQL server has gone away in C:\\xampp\\htdocs\\auctioneerslive\\system\\library\\db\\mysqli.php on line 7


gsc1ugs wrote:I have just changed db_driver from mysqli to MySQL which are both available and got this... ive hidden some credentials, this is defineatly a db driver issue but not sure what to do about it

No it is not. Read the red box: http://php.net/manual/en/function.mysql-connect.php

Re: waiting for localhost

PostPosted: 08. March 2016 17:54
by gsc1ugs
Altrea wrote:No it is not. Read the red box: http://php.net/manual/en/function.mysql-connect.php


Sorry, don't understand, which bit, its a large page

Re: waiting for localhost

PostPosted: 08. March 2016 18:20
by Altrea
There is only one red box very early at the top of this page

Re: waiting for localhost

PostPosted: 08. March 2016 18:48
by gsc1ugs
So no sqli?

Re: waiting for localhost

PostPosted: 09. March 2016 01:08
by Altrea
No...
The old MySQL Drivers are removed in PHP 7.0.
So you need to use MySQLi or PDO (which are two new MySQL drivers) to connect with your MySQL Database

Re: waiting for localhost

PostPosted: 09. March 2016 09:32
by gsc1ugs
Its the mysqli thats hanging

Re: waiting for localhost

PostPosted: 09. March 2016 10:10
by Altrea
I know (!!!)
but you was wondering about the message which occurs if you switch the Database driver to old MySQL...

Re: waiting for localhost

PostPosted: 09. March 2016 10:22
by gsc1ugs
Yes that is correct, I get an error message which would be nice with mysqli, I'm stumped

Php connection type PHP Version 7.0.4

PostPosted: 09. March 2016 10:49
by gsc1ugs
Hi

I have a problem with connection using latest xampp for windows, what connection should I use that works with PHP Version 7.0.4, ive been told MySQL is not supported in this version

Thanks inadvance

Re: Php connection type PHP Version 7.0.4

PostPosted: 09. March 2016 11:10
by Altrea
Hi,

You have also been told that you should use MySQLi or PDO.

Re: Php connection type PHP Version 7.0.4

PostPosted: 09. March 2016 11:21
by gsc1ugs
Thanks Altrea ... that's what the waiting is... what is the syntax for using PDO?

Re: Php connection type PHP Version 7.0.4

PostPosted: 09. March 2016 11:25
by Nobbie
The syntax is described in the PDO manual: http://php.net/manual/en/book.pdo.php

Re: Php connection type PHP Version 7.0.4

PostPosted: 09. March 2016 11:43
by gsc1ugs
This is re-inventing the wheel, this site works online, its obviously configuration with XAMPP which I'm very close to uninstalling, ive got SQL server but I don't want all that on the system, I just want phpmyadmin which also works and ive created the database, mysqli should work but it spinning the localhost and ive no way of checking why, I thought this xampp forum would have an idea

Re: waiting for localhost

PostPosted: 09. March 2016 12:19
by gsc1ugs
Just made a small file to connect and placed it online to my site it works fine, I have the same problem, this must be the MySQL in xampp, any other sugestions

Code: Select all
<?php
// Version
define('VERSION', '2.1.0.1');

// Configuration
if (is_file('config.php')) {
   require_once('config.php');
}

// Install
if (!defined('DIR_APPLICATION')) {
   header('Location: install/index.php');
   exit;
}

// Startup
require_once(DIR_SYSTEM . 'startup.php');

// Registry
$registry = new Registry();

// Loader
$loader = new Loader($registry);
$registry->set('load', $loader);

// Config
$config = new Config();
$registry->set('config', $config);

//Step1
$db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE, DB_PORT);
 if (!$db) {
    die("Database connection failed miserably: " . mysql_error());
 } else {
   die ("Success");
 }
 

?>
<html>
 <head>
 <title>Success</title>
 </head>
 <body>

 </body>
</html>