This Help forum is for issues relates to the latest release (1.7.10/11/12). For issues related to development versions please use their own Help forum.
Before asking for help please read "How to request help" by clicking on that tab above here."

TOPIC: Installation 101

Installation 101 3 weeks 2 days ago #1

  • sjschmidtky
  • sjschmidtky's Avatar
  • Offline
  • New
  • Posts: 11
I'm trying to install webtrees for the first time on my Windows 10 server. I've installed MySQL V8.0.14 and PHP V7.2.12 and Apache v2.4. I've created a database 'webtrees", created a user and granted all access to the database to the user.

I get past the screen confirming my server configuration and server capacity are OK. When in enter the database user name and password, i get this message:

Unable to connect using this username and password. Your server gave the following error.
SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
Check the settings and try again.

I expect I'm missing something simple with how I configured MySQL. Any ideas for me?

Thanks, Steve
The administrator has disabled public write access.

Installation 101 3 weeks 1 day ago #2

  • fisharebest
  • fisharebest's Avatar
  • Online
  • Administrator
  • Posts: 10573
You are using PHP 7.2 with MySQL 8.

MySQL 8 introduces a new authentication method, and makes it the default.
PHP 7.2 does not yet know how to use this authentication method.
There is a bug report here: bugs.php.net/bug.php?id=76651

You can to change your MySQL server to use the older authentication method.
See mysqlserverteam.com/upgrading-to-mysql-8...ugin-considerations/
This will only affect user accounts created after the change.

You can also modify the existing user account to use the new authentication module.
I don't have the syntax to hand, but it's on the MySQL website.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.

Installation 101 3 weeks 1 day ago #3

  • sjschmidtky
  • sjschmidtky's Avatar
  • Offline
  • New
  • Posts: 11
Greg,

Thanks for the help. I've done as you recommended and have moved forward. I was successful to the point of it building the webtrees database and now received this error message:

Warning: parse_ini_file(data/config.ini.php): failed to open stream: No such file or directory in C:\Apache24\htdocs\webtrees\site-unavailable.php on line 47

Oops! The webserver is unable to connect to the database server. It could be busy, undergoing maintenance, or simply broken. You should try again in a few minutes or contact the website administrator.
If you are the website administrator, you should check that:
the database connection settings in the file “/data/config.ini.php” are still correct
the folder “/data” and the file “/data/config.ini.php” have access permissions that allow the webserver to read them
you can connect to the database using other applications, such as phpmyadmin
If you cannot resolve the problem yourself, you can ask for help on the forums at webtrees.net

Thanks for your continued help!!!

Steve
The administrator has disabled public write access.

Installation 101 3 weeks 1 day ago #4

  • fisharebest
  • fisharebest's Avatar
  • Online
  • Administrator
  • Posts: 10573
1) The page has a "try again" link. Did you click this link?

The error says that the file data/config.ini.php does not exist. This file is created during setup. If it doesn't exist, then perhaps your webserver does not have permission to write to this folder, or perhaps there was an error while creating the database.


Also, try replacing the file site_unavailable.php with an updated version from here:
github.com/fisharebest/webtrees/blob/1.7/site-unavailable.php

It contains a small change that can sometimes show a more helpful error message.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.

Installation 101 3 weeks 1 day ago #5

  • sjschmidtky
  • sjschmidtky's Avatar
  • Offline
  • New
  • Posts: 11
Thanks again for hanging in there with me. I can find neither file when I do a search with explorer. Should I reinstall php or apache or both?

Steve
The administrator has disabled public write access.

Installation 101 3 weeks 1 day ago #6

  • fisharebest
  • fisharebest's Avatar
  • Online
  • Administrator
  • Posts: 10573
The setup wizard asks for your database credentials, and stores them in this file.

If the file does not exist, you should run the setup wizard to create it.

It is created after the database scripts have run.
So, if there's an error in the setup scripts, it won't get created.

The updated file I mentioned above may help to discover such errors.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.

Installation 101 3 weeks 1 day ago #7

  • sjschmidtky
  • sjschmidtky's Avatar
  • Offline
  • New
  • Posts: 11
I expect you're getting tired of me by now... I've changed the site-unavailable.php file to the contents you sent me earlier and now getting this error when I run the setup wizard again: Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in C:\Apache24\htdocs\webtrees\site-unavailable.php on line 16

I apologize for being inexperienced here.

Is there something I can send that would help diagnose this easier for you/us?
The administrator has disabled public write access.

Installation 101 3 weeks 1 day ago #8

  • fisharebest
  • fisharebest's Avatar
  • Online
  • Administrator
  • Posts: 10573
> I've changed the site-unavailable.php file to the contents you sent me earlier

Are you sure?

> Fatal error: Namespace declaration statement has to be the very first statement

This error suggests that you didn't download/copy the file correctly. Can you check again.

From the link above, click "Raw" and then use your browser to download/save the file.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.
Do you need a web hosting solution for your webtrees site?
If you prefer a host that specialises in webtrees, the following page lists some suppliers able to provide one for you: 

Installation 101 3 weeks 1 day ago #9

  • sjschmidtky
  • sjschmidtky's Avatar
  • Offline
  • New
  • Posts: 11
Ok, I selected raw and copied/pasted the lines into the file in notepad (I’m using Windows). Maybe it’s truncating a line. I’ll try again doing as you say.

Thanks, Steve
The administrator has disabled public write access.

Installation 101 3 weeks 4 hours ago #10

  • sjschmidtky
  • sjschmidtky's Avatar
  • Offline
  • New
  • Posts: 11
I re-copied in the raw lines and to the file and still getting the error message. I'm not a php developer, but don't see anything obvious that is incorrect - looks like namespace is the first command after the comments.

I've attached the file here (remanded to a txt extension). See anything that I'm doing wrong?

Hoping to get further here do I can return to diagnosing why the original message about the missing ini file.

Thanks, Steve

This message has an attachment file.
Please log in or register to see it.

The administrator has disabled public write access.

Installation 101 3 weeks 4 hours ago #11

  • sjschmidtky
  • sjschmidtky's Avatar
  • Offline
  • New
  • Posts: 11
also, regarding permissions, I've stored the webtrees files in the htdocs folder within the Apache folder. Perhaps there is a permissions problem even though webtrees files are within the apache folder, but I don't know how to check permissions. Any advice here too would be appreciated.

Thanks still,

Steve
The administrator has disabled public write access.

Installation 101 3 weeks 3 hours ago #12

  • fisharebest
  • fisharebest's Avatar
  • Online
  • Administrator
  • Posts: 10573
> but I don't know how to check permissions

The setup script *does* check for permissions in the /data folder - by creating a temporary file.
However, it doesn't try to write the file until *after* it has created the database.
I would guess that your problem is *not* file permissions.

You presumably failed to create all the tables, etc. in your database.

Now, the site-unavailable page should only be triggered if the config.ini.php file *does* exist, and webtrees cannot use the information within it to connect to the database.

If you are being redirected here, then the file presumably exists.
But you tell me it doesn't.

Start again from the beginning. Tell me *exactly* what you do, and what happens.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.

Installation 101 2 weeks 6 days ago #13

  • sjschmidtky
  • sjschmidtky's Avatar
  • Offline
  • New
  • Posts: 11
Ok - starting from the beginning (all in Windows 10):

1. Installed Apache, MySQL, and PHP (watched a YouTube video and followed along).
2. Downloaded webtrees zip file from launchpad.net/webtrees
3. Unnzipped the files and put them into a subdirectory called 'webtrees" in the 'Apache24/htdocs' directory.

4. Using the MySQL command line, I entered the following commands:
create database webtrees;

create user sjschmidtky@localhost identified by password;
grant all privileges on webtrees.* to sjschmidtky@localhost;

I entered 'show databases;' and saw that the webtrees database was created.
I entered 'show user,host from MySQL.user;' to see that my user id was there.
5. Now to the browner and typed /localhost/webtrees. this provides me a directory list of the files in webtrees (haven't figured out why it's not running index.php for me right away).
6. Clicked in the directory list on the index.php file
7 First webtree screen comes up and server config and server capacity are checked, click 'continue'

8. Get to database connection screen. Leave 'localhost' and '3306' in the first two fields. Enter 'sjschmidtky' into user account and 'password', click continue
9. On the next screen enter the database name 'webtrees" and leave the table names field at default, click continue
10. Enter administrator account information (name, id, password, email. press continue.
11. Get the error: Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in C:\Apache24\htdocs\webtrees\site-unavailable.php on line 16

I used to get another screen (provided above in an earlier message), but now get the fatal error after replacing the code as instructed above.

I've attached a jpg of the files list in my webtrees directory.

Hope this helps.


I really appreciate your help. I still suspect I'm missing something obvious, but I'm a novice for sure.

Steve
Attachments:
The administrator has disabled public write access.

Installation 101 2 weeks 5 days ago #14

  • sjschmidtky
  • sjschmidtky's Avatar
  • Offline
  • New
  • Posts: 11
Greg
Any new advice for me re my response for info starting from the beginning? Wondering I should give up or not.
Thanks
The administrator has disabled public write access.

Installation 101 2 weeks 5 days ago #15

  • kiwi
  • kiwi's Avatar
  • Offline
  • Platinum
  • Posts: 4918
Earlier you said “Ok, I selected raw and copied/pasted the lines into the file in notepad (I’m using Windows).”

That might be your problem. Notepad will often add a “bom” (byte order mark) at the start of a file. You cant see it, but it will prevent a php file from working.

You need to use a better text editor ,that can be configured not to add bom (usually the default for better products ). Personally I favour “Atom”, but there are others.

But in this case download a complete copy of latest webtrees from github and extract just the site-unavailable.php file rather than copy/pasting bits of code.
Nigel

www.our-families.info

Hosted at:
Follow me at:
The administrator has disabled public write access.

Installation 101 2 weeks 5 days ago #16

  • fisharebest
  • fisharebest's Avatar
  • Online
  • Administrator
  • Posts: 10573
> Get the error: Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in C:\Apache24\htdocs\webtrees\site-unavailable.php on line 16

Here I am presented with conflicting information. You PHP interpreter tells me there is a problem with the file. You say you copied it 100% exactly. Rather than beat this to death, let us try another attack. Edit the file app/Database.php...

Find the block of code at the bottom, which is highlighted here:

github.com/fisharebest/webtrees/blob/1.7...tabase.php#L314-L316

Replace these three lines with
var_dump($ex);

Now try again. You should hopefully end up with an error message.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
Last Edit: 2 weeks 5 days ago by fisharebest.
The administrator has disabled public write access.

Installation 101 2 weeks 3 days ago #17

  • sjschmidtky
  • sjschmidtky's Avatar
  • Offline
  • New
  • Posts: 11
Greg,

Well, this is not getting better, is it? I presume you mean the Database.php file in the Webtrees/app subdirectory, right? I don't see the code you mention above. I've attached the file here for you to look through if you wish.

I want to also mention again that I installed PHP 7.2.12 - could that be a problem? Might there not be files built because I've installed this version of PHP?

Sorry to be such a persistent pain on this. It doesn't help that I know nearly nothing about PHP and smattering on SQL.


Thanks, Steve

This message has an attachment file.
Please log in or register to see it.

The administrator has disabled public write access.

Installation 101 2 weeks 3 days ago #18

  • fisharebest
  • fisharebest's Avatar
  • Online
  • Administrator
  • Posts: 10573
> I presume you mean the Database.php file in the Webtrees/app subdirectory, right

Correct.

> I don't see the code you mention above.

So, what do you see?

> I've attached the file here for you to look through if you wish.

The attachment didn't work.

> I want to also mention again that I installed PHP 7.2.12 - could that be a problem?

No, that is not an issue. I'm using the same version of PHP on my development machine.

> It doesn't help that I know nearly nothing about PHP and smattering on SQL.

You don't need to know anything about PHP or MySQL
You just need to be able to delete a few lines from a text file.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.

Installation 101 2 weeks 2 days ago #19

  • sjschmidtky
  • sjschmidtky's Avatar
  • Offline
  • New
  • Posts: 11
Sorry for the delay... trying the attachment again...

This message has an attachment file.
Please log in or register to see it.

The administrator has disabled public write access.

Installation 101 2 weeks 2 days ago #20

  • fisharebest
  • fisharebest's Avatar
  • Online
  • Administrator
  • Posts: 10573
Well, the file looks OK.

It shows that the first statement in the script is "namespace" at line 16.

Yet you are getting this error message:

> Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in C:\Apache24\htdocs\webtrees\site-unavailable.php on line 16

Something else must be going on, and I cannot think what it might be.

In summary, I think there are two issues.

1) there is something wrong with your database configuration that causes an error when webtrees tries to create its tables.

2) there is something wrong with your PHP setup. Are you using one of the "free webhosts" that injects adverts or other content into your pages? I've seen these cause similar problems.

Final thought. When you run the setup, and get redirected to the "site-unavailable" page, what is the full URL of this page? There may be an error message encoded in the URL.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.
Powered by Kunena Forum