0

i have set up a home server for testing a basic web CRUD app i designed. the page is being served on the web correctly, however whenever i attempt to enter credentials, login, create new users, or upload content, nothing happens. i can not login with my credentials, new users are not being registered in the database, etc. when i browse through the site with the path for each of the pages, they pull up correctly however.

the server in question is a lamp server, running ubuntu server. **is there a mysql configuration file im not aware of? do i need to forward port 3306 to the server? or is this what the binding address is for? ** i dont mean to make this seem like an off topic question with my own proposed thoughts, but i want to solicit feedback if i am in the right direction trying to solve this problem.

i have the site installed locally on my machine here, with all the same source code and same exact database, and it is serving locally as it should. but from my server at home i am experiencing the above listed problems.

troubleshooting i have done so far is going through lamp installation guides, a number of them, and i have (remotely) uninstalled and reinstalled all of the components of the server today. my next step is to re-install the ubuntu server on the machine itself, however i wont have physical access to it until tomorrow.

also, i do not want to be the only person to be able to access and use the site, so whatever solution i would like it to be global

  • It seems your application is not actually making a connection to the database. Check the database name, database user, database password and database server that are being used in making the connection. Do they also work if you e.g. use them in an ordinary mysql command? – Jos Jul 1 '17 at 21:18
  • Yes that's what I think the problem is,Part of the problem I'm used to using xampp and phpmyadmin which I didn't install so I'm not familiar with doing all those things – user74091 Jul 1 '17 at 21:20
  • I did the /s command and it says the user is root@localhost, so should it be root@mydomain.com ? – user74091 Jul 1 '17 at 21:23
  • Well, you could turn on the MySQL access log, then access your application, and see if this gets logged. Then turn off the access log. But from your question I don't expect much being logged. – Jos Jul 1 '17 at 21:24
  • 1
    As for the user: no, that should be OK as on a LAMP server the database server is the same as the web server (and therefore "localhost"). – Jos Jul 1 '17 at 21:25
1

this was the problem, originally my connection function looked like this;

<?php

$conn = mysqli_connect('www.mydomain.com', 'root','mypassword', 'dbname');    
mysqli_select_db($conn, 'dbname');

when it should have looked like this;

<?php

$conn = mysqli_connect('localhost', 'root','mypassword', 'dbname');    
mysqli_select_db($conn, 'dbname');

i thought since i was conncting the site to the internet instead of just serving it locally on my machine, i needed to USE my server address as the host name, but thats not correct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.