Skip to content
This repository has been archived by the owner on Jan 25, 2021. It is now read-only.

Something wrong with Installer. #29

Closed
halojoy opened this issue Jun 21, 2015 · 8 comments
Closed

Something wrong with Installer. #29

halojoy opened this issue Jun 21, 2015 · 8 comments

Comments

@halojoy
Copy link
Contributor

halojoy commented Jun 21, 2015

There is something wrong with the 0.5.1 installer.
I can fill in the database user and password.
But when I submit it won't let me connect to database.
Error. Access denied for user '' @ 'localhost'

Probably something with dbname, username or password.
I have tested other software and there is nothing wrong when installing them.

@brunnopleffken
Copy link
Owner

@halojoy
I downloaded 0.5.1 directly from GitHub, created a new database and tried to install... Well, I couldn't reproduce this issue, so I need more details...

Instead "localhost", try to connect using 127.0.0.1. Seems like you're not using an username, are you connecting as anonymous? This first step when submitting the database settings it just run a basic mysqli_connect() query to verify the data, and it returns just true or false (install/tests.php).

@halojoy
Copy link
Contributor Author

halojoy commented Jun 22, 2015

THe error comes at this line:
$installer = new Installer;
I tracked it.
And yes, I have tried 127.0.0.1. I have tried everything I can.
Still I can not come any further than beginning of step 3.

I am using port 3306, username=root and my password.
Full error: "Access denied for user ''@'localhost' (using password: NO)"

@brunnopleffken
Copy link
Owner

I see... Seems like those parameters are not being passed to Installer() class, so the script is trying to connect to nowhere using empty values, otherwise you had seen "Access denied for user root@localhost (using password: YES)"...

I'll investigate this issue. Just to know, which PHP version are you running? I want to make some tests matching the same environment as you have as much as possible.

NOTE: may be related to #26

@halojoy
Copy link
Contributor Author

halojoy commented Jun 22, 2015

I actually run PHP 5.6.10, latest. On Apache 2.4.12, latest. MySQL is 5.6.16.
And I agree with you. Trying to connect with empty values.
This is happening before the real connection. Maybe in the database class.

@halojoy
Copy link
Contributor Author

halojoy commented Jun 22, 2015

The Database class has got a constructor. = _Connect
When the Installer implements Database and gets called, this constructor is run.

I got it working after hard work.
I made the Database class has no constructor.
Call to Database is now 2 steps:

$Db = new Database();
$Db->_Connect($config);
I also had to make the _Connect public, in the Database class.

@brunnopleffken
Copy link
Owner

Man, that's awesome! Can you send a PR with this fix?
And then I replace all other Database calls with this two steps to get everything else back to work...

By the way, you can remove the underscore before Connect(), as it's now public.

;)

@halojoy
Copy link
Contributor Author

halojoy commented Jun 23, 2015

I am sorry. I tried to make a Pull Request. But I don't know how :(
The strange thing is that the code 0.5.1 works for you, but not for me in PHP 5.6.10.

In Database.php. The Database class.

  • Block out the constructor (or delete it)
  • Make Connect public

Everywhere it is a database call:
$Db = new Database();
$Db->Connect($config);

That is all.

@brunnopleffken
Copy link
Owner

Yeah, that's the wierd part... I set my Apache to run 5.6.x and everything still works fine as should be... I need to see what's going on, because now I'm not relying on my dev environment that much...

OK, I'll do this modification and send the commit myself, and this fix will be credited to you in the changelog. ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants