justicenode / php-wol

PHP WakeOnLan Interface
GNU General Public License v3.0
33 stars 19 forks source link

Can't log in after installation #1

Closed djraw closed 6 years ago

djraw commented 6 years ago

Hi there and happy new year, after I fixed some issues with MariaDB and nginx using php7.0-fpm on my Raspberry Pi 3 (Raspbian Stretch) I got the interface almost running.

Now I can't log in as I don't know the decrypted default password which you supply with the INSERT statement and can't get inserting another user to work. It also might be a problem that I need to use PHP7 which seems to not support the mysql_escape_string() in auth.php which I changed to mysql_real_escape_string() due to some hints after searching the web. Didn't change the log entries though. `2018/01/06 19:20:32 [error] 30921#30921: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to undefined function mysql_real_escape_string() in /var/www/html/local/php-wol/auth.php:47 Stack trace:

0 /var/www/html/local/php-wol/login.php(17): Auth->login('admin', 'password')

1 {main}

thrown in /var/www/html/local/php-wol/auth.php on line 47" while reading response header from upstream, client: 192.168.0.2, server: 192.168.0.213:8000, request: "POST /php-wol/login.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.0.213:8000", referrer: "http://192.168.0.213:8000/php-wol/" `

Anyway, the first step for me is to try with the correct password to be able to really debug and exclude that the error comes up because of the wrong password.

Edit: first step is to use mysqli - mysql functions are deprecated now with php7 .. now I get another error because the function expects 2 parameters but gets only one.

djraw commented 6 years ago

Never mind, using another solution now - closing this.

HellStorm666 commented 5 years ago

fixed it, if you are still interested. admin - admin and in auth.php on line 47 change the mysql_escape to: mysqli_real_escape_string($db, $username)