Can't register

Hello!

I have install Emoncms on Raspberry Pi 3 with MySQL, Apache2 and PHP7. Now when i would to create a user i get an error: “[object Object]”

Any idea what is the problem?

Thanks for help!

Is there any more info available if you have the browser dev console [ctrl-f12] open whilst you try and create a new user?

This is what i get from Emoncms: [object Object]

This is what i get from the Browseranalysis:

404 Not Found

Not Found

The requested URL /emoncms/user/register.json was not found on this server.


Apache/2.4.25 (Raspbian) Server at 192.168.200.114 Port 80

404 Makes me nervous.

Did you follow a guide to install emoncms?

Are you seeing any emoncms screens at all eg the login screen or are you getting this error without any entering any user details?

Do you see the apache2 test page at http://192.168.200.114?

Yes, i follow this guide: emoncms/readme.md at master · emoncms/emoncms · GitHub

Yes, i see the Test page. PHP Version 7.0.27-0+deb9u1. Apache, MySQL and PHP runs perfect. My other PHP Scripts runs without error.

On Emoncms i can switch between Login Screen and Register Screen. Thats all.

Could this be the same issues as:

There’s not enough info to 100%, but I doubt it as the reported error is different, the other issue raised a “Error creating user” rather than a “[object Object]” error and the broswer console is reporting it cannot find /emoncms/user/register.json so at this point I suspect a virtual host or rewrite mod type issue.

Walter - can you confirm if the file is present using

ls -la /var/www/emoncms/Modules/user/register.json

or

ls -la /var/www/html/emoncms/Modules/user/register.json

[edit - having now had a chance to check the source code I can now see there is no user/register.json file and that it is an api path to a function, so the preceeding test to see if the file exists isn’t valid]

Can you confirm the apache rewrite module is enabled using

sudo apachectl -M

you should see “rewrite_module” listed.

You say you have other PHP content, have you made any changes to what is in the guide to accomadate other website content?

Also when did you clone emoncms? and what branch are you on?

Thirst, thanks for your help!

The file register.json is missing into /var/www/emoncms/Modules/user/.

I clone the files from emoncms/Modules/user at master · emoncms/emoncms · GitHub. Here is the files also missing.

The rewrite_module is listed yes.

No, I have made the configuration strictly according to instructions. I have not made any changes to Apache or PHP. Everything as in the instructions.

I clone emoncms three days ago. Branch, for what?

I found a Solution:

I add this line at /etc/apache2/apache2.conf:

<Directory /var/www/html/emoncms/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted

Thank you very much for your help.

That’s good to hear, Is it possible you missed this line of the guide?

For <Directory /> and <Directory /var/www/> change AllowOverride None to AllowOverride All. This should be on, or very close to lines 161 and 172 of /etc/apache2/apache2.conf

or possibly this line didn’t execute succesfully

cd /var/www/html && sudo ln -s /var/www/emoncms

I’m not sure why the fix you have found should work if the existing stuff didn’t

can you please tell us what this returns

ls -la /var/www/{html/,/}

ls -la /var/www/{html/,/} return:

lrwxrwxrwx 1 root root   16 Feb 21 09:35 emoncms -> /var/www/emoncms
-rw-r--r-- 1 root root   51 Feb 17 13:07 index.php
drwxrwxrwx 4 root root 4096 Feb 18 10:36 sensoren

Here is my working /etc/apache2/apache2.conf:

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted

<Directory /var/www/html/emoncms/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted

I made this step: cd /var/www/html && sudo ln -s /var/www/emoncms
When i repeat this step i get It already exists.

I don’t no realy why, but it works.

That’s not the whole reply is it? There should be more, there is no sign of the emoncms folder, Can you run these 2 separate commands and return all of the reply for each please

ls -la /var/www/html
ls -la /var/www/

Can you also confirm if “emoncms → /var/www/emoncms” line is in green or red text

You previously said you could see the test page

But your last post shows the “index.html” is not there and there is a “index.php” so I assume you have changed things in the interim and now carried out this part of the guide which changes the routing and the baseurl.

Return of ls -la /var/www/html:
drwxrwxrwx 3 root root 4096 Feb 21 09:35 .
drwxrwxrwx 4 root root 4096 Feb 22 09:08 …
lrwxrwxrwx 1 root root 16 Feb 21 09:35 emoncms → /var/www/emoncms
-rw-r–r-- 1 root root 51 Feb 17 13:07 index.php
drwxrwxrwx 4 root root 4096 Feb 18 10:36 sensoren

Return of ls -la /var/www/:
drwxrwxrwx 4 root root 4096 Feb 22 09:08 .
drwxr-xr-x 12 root root 4096 Feb 17 13:00 …
drwxr-xr-x 8 root root 4096 Feb 22 09:09 emoncms
drwxrwxrwx 3 root root 4096 Feb 21 09:35 html

Yes, i can confirm. The “emoncms” is in green text. That should be the soft link.

I delete the Apache Testpage and made a index.php with:

<?php phpinfo (); ?>

to check the Versions.

Hmm, yes, i think you are right. I skip this part:

sudo su
echo “<?php header('Location: ../emoncms'); ?>” > /var/www/html/index.php
rm /var/www/html/index.html
exit

Maybe that was the missing part of the problem.