Question

I am having a problem running my PHP script to store login/registration details into MySQL Database on a Bluehost site.

S placed my PHP files in public_html/mobileapp/registration/ on the server. I have three files: config.php, db_connect.php and db_functions.php. (I used these same functions in local test using localhost and they worked fine). Here are my database connection details:

define('DB_USER', "user"); 
define('DB_PASSWORD', "password"); 
define('DB_DATABASE', "test"); 
define('DB_HOST', "server-name.com");

$con = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);

I can access these files from server-name.com/mobileapp/registration/ and I don't get an error. However, in my Android App/Java code I keep getting a 404 Page Not Found error, and see this in the error log for Bluehost server:

[Sun Jan 19 20:09:12 2014] [error] [client 184.65.36.11] Attempt to serve directory: /public_html/mobileapp/registration/

So my question is, what page is it not finding? The PHP Script?

Sorry if its an easy question but I can't figure it out. From some searching online the Attempt to server directory error has to do with the DirectoryIndex?

Was it helpful?

Solution

I am somewhat confused by this question. There are only a handful of things that are likely to occur when accessing a directory without a filename specified as an end result.

  1. There is an existing permalink structure that will handle this.
  2. You are served with a listing of the files in the directory (less options -indexes).
  3. You will be served with the default page found through hierarchical traversing the DirectoryIndex directive.
  4. You will be served a 403 error due to the a DirectoryIndex not found, options -indexes being present and there is no permalink structure to handle this request.

In your case, the scenario that you've described is only possible if there is a permalink structure that is specifically for non-mobile platforms.

Otherwise, inside of public_html/mobileapp/registration/ make an .htaccess file and then give it a directory index.

DirectoryIndex config.php index.php index.html

By default, this will serve config.php if it exists. if not, then it will serve index.php so on and so forth.

OTHER TIPS

Escalate Hosting actually in depth tutorials for these exact kinds of issues. Maybe not with bluehost, no. But they do have an extensive database of tutorials for different kinds of scripting for different types of OSs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top