mirage
mirage

Reputation: 111

CakePHP from localhost to remote server - blank page

i am trying to figure this out for a long time now, but so far no luck, maybe somebody can help me.

I have a 2.2.2 cakephp installed on my computer (localhost) and everything works perfectly. But now i want that same project to be online on remote server. I upload everything, set mysql path but i get a blank page when trying to access the site.

If i upload a fresh cakephp it works, but my project doesnt. The debug is set to default, think that should be 2? I also deleted files in cache/tmp, but still no errors or anything, just blank page.

Any info would be helpful, thank you.

Upvotes: 2

Views: 6195

Answers (4)

DanMan
DanMan

Reputation: 11

I uploaded changes to my cakephp website and discovered that all actions for a particular controller returned a blank page. I discovered what the error was and was able to reproduce it with another controller.

The problem was that in the first line of my controller file I had a space before the opening php tag.

One space cost me hours.

Upvotes: 1

mirage
mirage

Reputation: 111

The real problem was only the coding I used in notepad++. All my files were encoded with UTF-8, but they should have been UTF-8 without BOM. After I changed it to UTF-8 withot BOM, everything started to work perfectly.

Upvotes: 0

alex.ac
alex.ac

Reputation: 1063

I hate when that happens :). Usually it does if there is an error somewhere and you can't see it because the errors are turned off, so you should call phpinfo() and see if display_errors is on. Changing the debug mode doesn't work every time since display_errors is set from php.ini.

Unfortunately, if this is the problem and you don't have access to edit the php.ini file, you might need to ask the hosting provider to change it and restart the php service.

You can also try this: error_reporting(E_ALL)

Upvotes: 2

Oldskool
Oldskool

Reputation: 34837

Just uploading all files won't cut it. Make sure you work through this checklist:

  1. First and foremost, check the error log file located under app/tmp/logs/error.log, this usually holds some very good pointers as to what is wrong.
  2. Make sure you have uploaded the app/Config/database.php file with the proper details. Local installs usually have user root without password. Online servers (obviously) do not!
  3. To that extent, also make sure you actually have a database with your hosting provider (either your host sent you the info or you need to create it yourself using their control panel).
  4. Make sure you also uploaded all .htaccess files (the one under the root directory and /app and /app/webroot), some FTP programs don't show this "hidden" file by default.

If all else fails, contact your hosting provider for further support as they usually have access to more verbose server logs that can also hold clues.

Upvotes: 0

Related Questions