Trouble with installation

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
LastoftheOutlaws
Posts: 8
Joined: Fri Nov 19, 2021 2:03 pm

Trouble with installation

Post by LastoftheOutlaws »

Script URL:
Version of script: 3.2.4
Hosting company: Self-hosted
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution: database connection failed hesk access denied

Write your message below:
Hi,

I'm unable to get the Hesk installer to connect to the MySQL database. I've created a user and granted all privileges to the hesk database. I also ran the MySQL test script I found in another thread and it confirms the credentials I'm entering into the installer are allowing a connection to the database so I'm at a bit of a loss as to what I'm doing wrong here. The error it's throwing me is:
Database connection failed:

Double-check all the information below. Contact your hosting company for the correct information to use!

MySQL said: Access denied for user ''@'localhost' (using password: YES)

It's like the installer isn't submitting any of the text from the fields to the settings file and is returning them blank? I've given the correct permissions to the files on the server as the installer requested. The self hosted server is running ubuntu 20.04 LTS, and I'm accessing the installer from Google Chrome if that helps. Thanks in advanced :)
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: Trouble with installation

Post by Klemen »

What PHP and MySQL versions are you running?

Can you try with a very simple username and password (no special chars, just a-z)?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
LastoftheOutlaws
Posts: 8
Joined: Fri Nov 19, 2021 2:03 pm

Re: Trouble with installation

Post by LastoftheOutlaws »

Sure I'm running the following versions:
PHP 8.0.13
MySQL 8.0.27-0ubuntu0.20.04.1

I tried it with a simple one word, one number password (so like: lemonade5, but not that) and it still fails with the same error. I can still connect to the hesk database with full access through a test script.
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: Trouble with installation

Post by Klemen »

What is the test script like? Does it only connect, or does it also select (use) the database?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
LastoftheOutlaws
Posts: 8
Joined: Fri Nov 19, 2021 2:03 pm

Re: Trouble with installation

Post by LastoftheOutlaws »

Klemen wrote: Fri Nov 19, 2021 2:51 pm What is the test script like? Does it only connect, or does it also select (use) the database?
It was this script that you posted over on this post, with the information changed to ours. It returns a "Connected." page
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: Trouble with installation

Post by Klemen »

Not sure what is going on then, something strange indeed.

If you are handy with PHP, you can edit file /install/install_functions.inc.php and just above

Code: Select all

// Use MySQLi extension to connect?
add

Code: Select all

print_r($_POST);
print_r($hesk_settings);
die();
Then submit and check what is being submitted and stored as

POST:
host
name
user
pass

hesk_settings:
db_host
db_name
db_user
db_pass
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
LastoftheOutlaws
Posts: 8
Joined: Fri Nov 19, 2021 2:03 pm

Re: Trouble with installation

Post by LastoftheOutlaws »

POST:
host: localhost
name: hesk
user: hesk
pass: (showing correct)

Copy and pasted output: [host] => localhost [name] => hesk [user] => hesk [pass] => (redacted, but correct!)

hesk_settings:
db_host
db_name
db_user
db_pass

All of the db_ fields are not showing anything (copied and pasted output is: [db_host] => [db_name] => [db_user] => [db_pass] => ). So does seem like it's not picking up the fields for the database.
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: Trouble with installation

Post by Klemen »

Any chance you can give me access to your help desk (via FTP)? That would speed things up a lot.

If not, I will reply and ask things to test when I can; for starters, you can upload this common.inc.php to your server (overwrite existing one in inc folder), run the install, and tell what output you get when trying to install.

Should be something like

1: test
2: test
4: test
5: test
6: test
FINAL: test
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
LastoftheOutlaws
Posts: 8
Joined: Fri Nov 19, 2021 2:03 pm

Re: Trouble with installation

Post by LastoftheOutlaws »

I would, but the install is on our internal server without a public IP. We're only going to be using the help desk internally. Sorry I know that makes it a pain!

So I replaced common.inc.php with the version you provided, and this is what was spat out at the top of the install page (I've changed what is the correct password to (password) but I'm using a burner password for now for diagnostic so I don't mind sharing it here going forward if that helps diagnostic as I'll be changing them all to more secure ones once I've got it working!):
1: Administrator
2: Administrator
4:
5:
6:
FINAL:
1: (password)
2: (password)
4:
5:
6:
FINAL:
1: localhost
2: localhost
4:
5:
6:
FINAL:
1: hesk
2: hesk
4:
5:
6:
FINAL:
1: hesk
2: hesk
4:
5:
6:
FINAL:
1: (password)
2: (password)
4:
5:
6:
FINAL:
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: Trouble with installation

Post by Klemen »

What do you get when you run this code on your server?

Code: Select all

<?php
$a = 'Test 123 Test';
echo "A: $a<br>\n";
echo "B: ".preg_replace('/(\d)/', '?', $a)."<br>\n";
?>
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
LastoftheOutlaws
Posts: 8
Joined: Fri Nov 19, 2021 2:03 pm

Re: Trouble with installation

Post by LastoftheOutlaws »

I get the following:
A: Test 123 Test
B:
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: Trouble with installation

Post by Klemen »

This means that regular expressions (preg_replace function) don't work on your server.

No idea why and unfortunately not something I can help with; try searching your favorite search engine or asking an Ubuntu community.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
LastoftheOutlaws
Posts: 8
Joined: Fri Nov 19, 2021 2:03 pm

Re: Trouble with installation

Post by LastoftheOutlaws »

That's further than I got by myself, I'm still learning alot of ubuntu so it may be that I didn't install PHP quite right. That's a great foundation to start looking further, thanks so much for your help. :D
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: Trouble with installation

Post by Klemen »

Maybe

Code: Select all

apt-get update
apt-get install libpcre3 libpcre3-dev
will do the trick?

Then re-compile PHP and server software if needed (if the last test script still returns "B" blank)?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
LastoftheOutlaws
Posts: 8
Joined: Fri Nov 19, 2021 2:03 pm

Re: Trouble with installation

Post by LastoftheOutlaws »

Sorry I left you hanging there, I was off for the weekend.

I gave that a go but it didn't work. I'm going to try a complete reinstall of PHP and try and get all the modules I need installed, including those ones you've mentioned there. I have snapshots of the server (and it's only running this service anyway) so it shouldn't take too long to give it a go.
Post Reply