Application setup issues
semzwart opened this issue · comments
When i follow al the instalation steps, and i install this in my webserver correctly with a database and added the tables, first of all the index.php file doesnt show anything in my browser, seconf of all when i register, and i want to login i get an http error 500 server error, and when i want to try to do a password reset i get a sql error, can you please fix these so it is ready to rock n roll thanks so much
Alright, just to be sure, I'm sure you already ensured much of what i'll say, but ill list some things that might be the matter:
-
Make sure you access the
.php
files through localhost, not by opening them directly in a web browser -
The 500 server error is generally caused by the server you are currently using. Some measures you can take for that are:
- If you are using Apache server, make sure it is updated along with the
PHP version
. - make sure you did not accidentally delete any images or files, since that error might also occur if it fails to load a resource.
- Make sure that any changes you might have done in the source code are error-free (the current code has been repeatedly tested and is free of any Language errors)
- One more way is to search for that error in your server stack, since some server stacks themselves have a common prevalent issue in their source code.
- [ Advanced Solution ] Check the
error_reporting
,display_errors
anddisplay_startup_errors
settings in yourphp.ini
file. They should be set toE_ALL
and"On"
respectively (though you should not usedisplay_errors
on a production server, so disable this and use log_errors instead if/when you deploy it). You can also change these settings (except display_startup_errors) at the very beginning of your script to set them at runtime (though you may not catch all errors this way):
error_reporting(E_ALL);
ini_set('display_errors', 'On');
After that, restart server.
-
As for the password reset system, the
url
for the password change is currently set to accesslocalhost/klik
. If your server URL is different, you might have to change the url in thereset-request.inc.php
file. -
SQL error means either an error in the source code or an error in your SQL version or installation. After hearing your issue, the source code was rechecked but no SQL errors were found, so you might want to ensure that your SQL version is updated and that your server/server-stack supports mysqli APIs
-
Also, if your login screen shows correctly but you are unable to login, i might need more details to understand the problem. Can you provide some screenshots of what is displayed on the screen?
A last solution might be to search these problems (as mentioned before) for your server currently being used, since some server stacks have bugs/problems and only their own developers can solve them.
You can also try deleting the KLiK project and all databases/files related to it, download it again from the repository and try to install it again.
First, modifying an entire project for one user is not really possible, since i cannot attach the .php files here and neither can i attach an edited copy of the project here. Although, what I CAN do and will do is provide the solutions to the problems that i understood after reading your recent reply.
Second, you just provided me with sensitive details about your website, which is ALWAYS dangerous. Do make sure that you change all the credentials after this 🙂
I also failed to access or ping the host you mentioned, although there was one with the name of http://rdbms.sstrato.de
(with an additional 's'). If you did not type the host name wrong and this one is incorrect, i will list the edited files in which you will have to change it back to whatever name your host has.
As for the index page showing nothing, that file automatically redirects a user to the login page if he/she is not logged it. The index page itself is the dashboard, and can only be accessed by logging in. No content being showed implies that the login process is not working correctly, and you might have to contact your hosting service
to check that as well, since all tests
on the current source code are running without any issues or errors.
The http 500 error is an error on the server side and can (in most cases) be resolved only by the hosting service. Even if i provide you the project copy with your details, if the server error is not resolved, it will still not work. I have listed all possible ways to fix it, and the last method is to contact your hosting service to fix it.
Solutions
- Make sure your db connect information is correct. The
username
of your domain is different forphpMyAdmin
, although the password is the same. You can recheck the username inside phpMyAdmin by looking at theDatabase Serve
panel on the right side of the screen.
The part underlined in red is the username used by your DBMS
-
It is recommended (as mentioned in the ReadMe), that the database you use for KLiK be named klik_database. You can either rename the database or delete it and re-import the database file, since i made changed so that it automatically created and uses a database with a certain name, so no additional step needs to be taken.
-
Change the following URL in on
line # 13
in thereset-request.inc.php
file to replacelocalhost
with your correct domain name
$url = "localhost/klik/create-new-pwd.php?selector="
. $selector . "&validator=" . bin2hex($token);
-
After signing up for a new account, open the
klik_database
insidephpMyAdmin
and manually verify that the new account is visible in theusers
table, meaning that the registration was successful. -
It is not really necessary to get an edited copy of the project with your information. All you need to do is to edit the
dbh.inc.php
and thereset-request.inc.php
file.
- dbh.inc.php
$serverName = "http://rdbms.sstrato.de/";
$dBUsername = "root";
$dBPassword = "example123";
$dBName = "klik_database";
As mentioned before, recheck your username and other credentials first.
- reset-request.inc.php [line # 13]
$url = "localhost/klik/create-new-pwd.php?selector="
. $selector . "&validator=" . bin2hex($token);
Also please provide Screenshots or Pictures of what is displayed when you try to access the
index.php
file