Hi,
I want to install emoncms on domainfactory hosting.
I uploaded all files from github (stable version), changed and uploaded settings.php. MySQL login and database information is correct. mySQL and PHP version are up to date.
When I call index.php from my webspace, there is an error message:
Can anyone help me please? Is there an installation PHP?
How are the database tables setup? Do they need to be manually set up?
Best regards,
Christian
danbates
(Daniel Bates)
2
Out of interest what are you trying to achieve?
Thereâs already a version of emoncms set up on the web, called emoncms.org. Is there a reason youâre not using that?
borpin
(Brian Orpin)
3
There are a number of things that need to be done from the command line / SSH. Have you looked at the Linux install guide?
Hi Brian,
I read the install guide for Shared Linux Hosting.
There are no instructions on how to create the mySQL tables. I followed the innstructions mentioned in the guide, but I receive the error mentioned above when calling index.php
@Daniel: emoncms.org changed to payed version. As I am already paying for my hosting, I want to host emoncms on my domainfactory hosting.
Best regards,
Christian
pb66
(Paul)
5
The sql tables are generated automatically when the first user is registered.
why are you âcalling index.phpâ ? Just navigate to the domain/emoncms root eg
http://myserver.com/emoncms
that will present the log-in dialog box, you can click âregisterâ and add your details (username, email and password x2) and on âcreate userâ you will be logged in (and the tables created).
1 Like
Hi Paul,
thank you for your support!
If I call the root folder domain/emoncms I exactly get the error I mentioned in my first post.
Very strange. When I enter the error message or parts of it in Google, I do not receive posts / information etc. on this.
I just get some general information on this e.g. php - Fatal error: Call to a member function fetch_row() on boolean - Stack Overflow
It seems as if emoncms tries to determine the number of users etc. ( User->get_number_of_users()) but fails with the mySQL query. But the mySQL are not there.
Best regards,
Christian
Hi,
just checked /emoncms/Modules/user/user_model.php:804
There is a query, selecting users from a mySQL table.
But how can emoncms select from a table if it is not yet created?
Are you sure emoncms is installing the tables on its on after first logon?
Best regards,
Christian
pb66
(Paul)
8
The blank database is created during the install steps and then the tables are created on first use. I do not know the exact instance the tables are created as successfully creating the first user is my first use. It certainly isnât âafter first loginâ as that wouldnât be possible.
Looking at the code you link, it does look like that is expecting there to be a âusersâ table by the time it reaches that point, but ordinarily there are no tables before 'http://server.com/emoncms" is called (there is no install step to create them), at which point the user login screen appears for the first user to be created. So if you are not getting the log-in screen, then somewhere in index.php or enroute to L804 of the user_model.php there must be a check/call to create the tables that isnât happening for some reason. I do not know where that is without delving into the code.
Is the âemoncmsâ mysql user correctly set up with the right permissions?
Hi Paul,
good point!
In index.php line 71 I see this:
It is setting up mySQL tables and it is loading the mySQL schema / table structure from each module in Modules directory (Files named _schema.php). Not after first login, but when calling index.php.
I also think that it fails at this point. Maybe of mySQL users right permissions.
I will check /debug this.
Thank you for your help!
Regards,
Christian
danbates
(Daniel Bates)
10
We can add this problem to the list of MySQL related issues perhaps.
emonCMS setup is failing to create parts of the database, itâs possible to create them manually.
(MySQL database setup for user registration. ¡ Issue #1016 ¡ emoncms/emoncms ¡ GitHub)
The issue linked here I encountered on a fresh install, it doesnât seem to be creating the same errors as what youâre seeing, but they could be related, worth a shot.
borpin
(Brian Orpin)
11
Might the update db script work?
https://github.com/openenergymonitor/emonpi/blob/master/emoncmsdbupdate.php
pb66
(Paul)
12
See this PR from @anna_carboncoop (thanks Anna), I do not know when this might get pulled in, but it seems an easy enough edit to make manually and worth a try as it fits your symptoms.