UnamSanctam / UnamWebPanel

MIT License
180 stars 58 forks source link

Cant login #159

Open karkaletsi opened 2 years ago

karkaletsi commented 2 years ago

basically i set up the web panel all good and when im trying to login it says "error something went wrong" when i go in console and i see what the problem is its this: image

UnamSanctam commented 2 years ago

Make sure that you have PHP 7.4 or above, and also check for any error.log files anywhere and if there are any logfiles in __UNAM_LIB\Logs

karkaletsi commented 2 years ago

no log files. I have PHP 7.4.3 CLI

UnamSanctam commented 2 years ago

Make sure that you copied over all the files, you'll have to find out how to enable error logs for your specific host to see what causes the error 500.

karkaletsi commented 2 years ago

I will try updating PHP

karkaletsi commented 2 years ago

Can I make it so it auto logs me in?

UnamSanctam commented 2 years ago

Sure you can code it to do that but that wouldn't really be good, since then anyone that gets the URL won't have to log in either.

karkaletsi commented 2 years ago

Ok tell me what to change sir

UnamSanctam commented 2 years ago

Well you can change it to that but you'll need to fix the error first since there's something wrong in your configuration. Are you just creating a local web panel for testing or a public web panel which external computers will connect to?

karkaletsi commented 2 years ago

Public web panel which external computers will connect to.

karkaletsi commented 2 years ago

I will try to add an old version of your webpanel to see if it still does that

karkaletsi commented 2 years ago

still same error hmm

karkaletsi commented 2 years ago

jquery.min.js line 2 is the error it says

UnamSanctam commented 2 years ago

It's a PHP error, the jquery line is just from the AJAX response. You'll have to check your PHP configurations since it's most likely the cause, the easiest would be to enable errors.

karkaletsi commented 2 years ago

error_reporting(E_ALL); ini_set('display_errors', '1'); put this in login.php and index.php and display_errors = On on both of my php.ini

karkaletsi commented 2 years ago

Where can i check for the errors, no file created on the logs folder

UnamSanctam commented 2 years ago

You should put it at the top of auth-ajax.php, then check all folders for an error.log file.

karkaletsi commented 2 years ago

Above the <?php right? I did that restarted apache tried logging in but no error.log anywhere

UnamSanctam commented 2 years ago

No below it.

karkaletsi commented 2 years ago

still nothing

UnamSanctam commented 2 years ago

It will be easier if you just set up something like WAMP (or XAMPP) instead, you only need Apache from WAMP and it will work.

karkaletsi commented 2 years ago

i guess i will leave the webpanel part, i remember the crypto miner startup didnt work did you manage to fix that?

UnamSanctam commented 2 years ago

I don't think it has ever not worked, except when you try to enter protected folders into "File Name" since it can't write to those.

Quagliada3kg commented 1 year ago

same problem here, can't login, no log, just the error in the photo. I tried with apache+php and nginx+php. I'm running it on a rasperry pi 3b (just becasue it was there) on a lite (no screen) x64 OS (the defaoult one)

sorry for the bad english it's late for me and it isn't my primary language...

UnamSanctam commented 1 year ago

same problem here, can't login, no log, just the error in the photo. I tried with apache+php and nginx+php. I'm running it on a rasperry pi 3b (just becasue it was there) on a lite (no screen) x64 OS (the defaoult one) sorry for the bad english it's late for me and it isn't my primary language...

Make sure that you have PHP 8.0 or newer and that no files are missing.

Quagliada3kg commented 1 year ago

updated it to 8.2, still not working

UnamSanctam commented 1 year ago

updated it to 8.2, still not working

Do you have any error logs inside the __UNAM_LIB\Logs folder or next to the auth-ajax.php file? Also, did you change config.php in any way?

Quagliada3kg commented 1 year ago

no error log anywhere, i changed only the password in config.php

UnamSanctam commented 1 year ago

no error log anywhere, i changed only the password in config.php

Then possibly it doesn't have permission to write the log, if you replace the config.php with a fresh one from the releases https://github.com/UnamSanctam/UnamWebPanel/releases then does it work?

Quagliada3kg commented 1 year ago

nop

UnamSanctam commented 1 year ago

nop

Then please post more information about the error and your setup, since your setup is the issue then it's hard to guess what the problem is with it.

Quagliada3kg commented 1 year ago

hardware:

software:

i think it's all

UnamSanctam commented 1 year ago

Can you check phpinfo() and see what it says regarding PHP version and such? And did you try fully removing all the files, then -re-extracting all the web panel files and then testing logging in with the default password?

Quagliada3kg commented 1 year ago

image image image image

UnamSanctam commented 1 year ago

Do you have php-sqlite installed or not? And can you enable error outputting and then look at the response from auth-ajax.php?

Quagliada3kg commented 1 year ago

php-sqlite it's installed, how can i enable error outputting?

UnamSanctam commented 1 year ago

Try changing this to 'on': https://github.com/UnamSanctam/UnamWebPanel/blob/b8b30b7b0412fa2f817fb80df9b561291eddb186/UnamWebPanel/class/class.base.php#L4

Quagliada3kg commented 1 year ago

ok then?

UnamSanctam commented 1 year ago

Try to log in and see what auth-ajax.php responds with in the developer console (in the network tab).

Quagliada3kg commented 1 year ago

image

UnamSanctam commented 1 year ago

Check the network tab for the auth-ajax.php.

Quagliada3kg commented 1 year ago

code 200 all ok but other error here

image

UnamSanctam commented 1 year ago

What does auth-ajax.php return? The CSS file doesn't matter since it's only a stylesheet.

Quagliada3kg commented 1 year ago


Warning: file_put_contents(/var/www/html/__UNAM_LIB/Logs/php-error-08-04-2023.html): Failed to open stream: Permission denied in /var/www/html/UNAM_LIB/unam_lib.php on line 235

Fatal error: Uncaught Error: Call to a member function prepare() on bool in /var/www/html/
UNAM_LIB/unam_lib.php:29 Stack trace:

0 /var/www/html/auth-ajax.php(11): unam_lib->unam_dbSelect()

1 {main}

thrown in /var/www/html/__UNAM_LIB/unam_lib.php on line 29

UnamSanctam commented 1 year ago

Yes then it wasn't allowed to write the errors like I thought (which is why there's no log), seems like the problem is that you're not able to open the database. Make sure that the PDO SQLite extension is both installed and enabled and that the db/unamwebpanel.db file and parent folder are both readable and writable.

Quagliada3kg commented 1 year ago

db/unamwebpanel.db have the permission, and SQLite is up and running

UnamSanctam commented 1 year ago

Give write permissions to the __UNAM_LIB/Logs folder so that it can write out any errors into that folder. But something is causing the database not to work, since I don't have access to the machine then it's hard to know why. Can you see the SQLite extension active inside phpinfo()?

Quagliada3kg commented 1 year ago

sorry if i disappeared but i had health problems, the folder has all permissions (they were pre-set) the sqlite info i can find on phpinfo() is this:

image image

Quagliada3kg commented 1 year ago

tried on a different pi3, fresh install and all, this times an error comes out on auth-ajax.php

image

UnamSanctam commented 1 year ago

Your server is likely unable to start/connect the SQLite database. Can you set write permissions for both the class and __UNAM_LIB/Logs folders? Then try to login and check if there's an error log in either the class folder or the __UNAM_LIB/Logs folder.

Quagliada3kg commented 1 year ago

this is the situation with permissions at the moment, no log files or anything

image