1

I'm very new and have never hosted a website before. I'm using cPanel and have a php website I've developed using XAMPP. I'm very confused as to how to use cPanel and how to upload my website to work as it did on XAMPP.

I uploaded all my files and folders using File Manager within the public_html folder. I selected the preview website option on the home screen and received a 500 Internal Server Error that stated:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@previewmywebsitenow.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.26 (Unix) mod_ssl/2.2.26 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 Server at www.previewmywebsitenow.com Port 80

I tried to look up the meaning, but I wasn't sure of how to fix my mistake. Did I upload everything the way I was supposed to? Also, if this is an error not occurred from my upload, how do I find the files or do the procedure I need to in order to fix this?

I appreciate any sort of explanation or instruction on how to continue this. I'm very new and please forgive my ignorance.

user5166162
  • 156
  • 2
  • 11

2 Answers2

1

Since you've worked with XAMPP, you will find CPanel friendly. Instead of putting your directories in the htdocs directory, you will be putting your working files and directories in the public_html directory.

Solving the Internal Server Error with PHP:

Kindly check your redirection header() function. You probably are missing the location keyword.

Example:

Error: header("home.php");

Hint: Add Location

Solution: header("Location: home.php);

0

cPanel is by the friendliest platform for hosting and is very welcoming for those who don't have huge experience in hosting. So, it won't get easier than that!

Now about the Internal Server Error that you're getting. Are you using Joomla or WordPress? If yes, you will need to change the configuration.php or the wp-config.php file respectively to accommodate the server. You will also need to create the database (and the database's users) on the web server using the MySQL Database tool in cPanel and then by exporting your actual database from XAMPP and then importing it there (you can do the import process using phpMyAdmin, after creating the database in cPanel).

itoctopus
  • 4,133
  • 4
  • 32
  • 44
  • I'm not using WordPress, Joomla, or any MySQL. The only thing I'm using php for is for some forms I've created. It's very small and pretty standard. – user5166162 Nov 04 '15 at 02:57
  • Check the Apache error logs - the error must be there somewhere. Do you have an `index.php` or `default.php` file? Are the permissions on this file correct? – itoctopus Nov 04 '15 at 03:00
  • I know this is probably a very ill informed question, but how do I access my apache error logs? Yes, I have a index.php within my public_html folder the permissions are 0644. – user5166162 Nov 04 '15 at 03:04
  • If you add a `die('Under Maintenance');` to the beginning of the `index.php` file, what do you get? Do you still get the Internal Server Error? – itoctopus Nov 04 '15 at 03:13
  • What if you rename your `index.php` to `index.php.old`, and then create a new `index.php` with just an `echo` statement, would you still see an error? If yes, then a quick call to your host would probably reveal the culprit. – itoctopus Nov 04 '15 at 03:42