Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Hosting PHP files

New Here ,
Nov 09, 2009 Nov 09, 2009

Hi,

I just added login functionality to my formerly html site and made all the pages into PHP pages. I uploaded all my files to my hosting site successfully, but when I tried accessing my site, it came up with an error. Then I created my index page as a .htm file, and it worked successfully again. I think it may be an error with my database because I don't think that I loaded that on the site. This is my first time uploading dynamic pages to the world wide web, but they have worked on my testing server. Does anybody know what the issue is, and does anybody know of a good tutorial for hosting a database?

Thank you!

TOPICS
Server side applications
861
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advisor , Nov 10, 2009 Nov 10, 2009

As the error message suggests, go to connAdmin.php and change the database login credentials that are found on line 9 of the file. You should have access to phpMyAdmin on your host that supports php. Contact your hosting provider for info on how to access phpMyAdmin remotely. Go to phpMyAdmin on your host and import your database that you exported from your localhost. Enter the login credentials that are used to access your remote database on line 9 of conn_Admin.php

Translate
Enthusiast ,
Nov 09, 2009 Nov 09, 2009

the hosting server needs to have the default file be index.php (or similar) so it knows to looks for that file as the default.

what happens when you go directly to that page (i.e. domain.com/index.php versus domain.com)?

if you're website is throwing php/mysql errors, and the errors are turned on in the ini file, then you would see the error.  if they are turned off, you will see a blank page.  you can setup a local testing environment to check your work, or you can do something like the following

<?php
error_reporting
(E_ALL);
ini_set("display_errors", 1);
include(
"file_with_errors.php");
?>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Nov 09, 2009 Nov 09, 2009

cycloneill wrote:

This is my first time uploading dynamic pages to the world wide web, but they have worked on my testing server.

jon wrote:

you can setup a local testing environment to check your work

redundancy

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 10, 2009 Nov 10, 2009

Also, yes, my file was named index.php and error reporting was on. The error message is the one I just posted.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Nov 10, 2009 Nov 10, 2009
LATEST

As the error message suggests, go to connAdmin.php and change the database login credentials that are found on line 9 of the file. You should have access to phpMyAdmin on your host that supports php. Contact your hosting provider for info on how to access phpMyAdmin remotely. Go to phpMyAdmin on your host and import your database that you exported from your localhost. Enter the login credentials that are used to access your remote database on line 9 of conn_Admin.php

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 10, 2009 Nov 10, 2009

cycloneill wrote:

I uploaded all my files to my hosting site successfully, but when I tried accessing my site, it came up with an error.

What was the error? If, as Jon says, the display of errors is turned on in the PHP configuration file, you should see an error message. Without knowing what the error message says, it's impossible to guess what the problem might be.

If the display of errors is turned off, use the code the Jon gave you to display the error message, and then post the details here so someone can help you resolve the problem.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 10, 2009 Nov 10, 2009

David_Powers wrote:

What was the error? If, as Jon says, the display of errors is turned on in the PHP configuration file, you should see an error message. Without knowing what the error message says, it's impossible to guess what the problem might be.

If the display of errors is turned off, use the code the Jon gave you to display the error message, and then post the details here so someone can help you resolve the problem.

Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user 'Kevin'@'localhost' (using password: YES) in /home/eperfu5/public_html/Connections/connAdmin.php on line 9

Fatal error: Access denied for user 'Kevin'@'localhost' (using password: YES) in /home/eperfu5/public_html/Connections/connAdmin.php on line 9

That was the error. I thought it had something to do with uploading a database to my host. Probably localhost shouldn't be involved in this website, but I don't know how to change it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines