4
votes

I'm having trouble with uploading my cakePHP project on a shared hosting ( from hostgator ). Here is what I have done: I've organized my cake distribution like this:

  • home/user/app
  • home/user/cake/cake
  • home/user/cake/vendors
  • home/user/cake/.htaccess
  • home/user/cake/index.php

    I have taken the content of webroot directory from app and put it in

    • home/user/public_html

    I've modified this file home/user/public_html/index.php ( the one that was in app/webroot ) changing these lines like this:

    • define('ROOT', DS.'home'.DS.'user');
    • define('APP_DIR', 'app');
    • define('CAKE_CORE_INCLUDE_PATH', DS.'home'.DS.'user'.DS.'cake');

    And that's about it.

    MY PROBLEM IS THE FOLLOWING:

    I have managed to deal with all the problems involved in the default index.php cakePHP page and I have a green and fully functional so to say, project. So when I access my "/", I get:

    "Your tmp directory is writable.

    The FileEngine is being used for caching. To change the config edit APP/config/core.php

    Your database configuration file is present.

    Cake is able to connect to the database."

    Now, I've created a model-view-controller with a mysql database background (like in the 15 min Blog Tutorial ), but when I'm trying to access some views ( e.g. /posts )...it gives me a blank page ( this worked perfect on my local machine virtual server apache ).

    What configuration am I missing ?

    Thank you.

EDIT: Apparently I had problems with the hosting. My URL was something like:

http://gator111.hostgator.com/~username/

and all I had to do was add an extra line in the webroot .htaccess:

RewriteBase /~username/

Thanks for the support.

1
setting your debug level to 2 in config/core.php might give you an error messagebrettkelly
It is set to 2. I've even tried with 3, but no errors, just the blank page.Progenitura
Check apache logs, that can give you a clue.RaYell
Try dumping out your cache folder, also.hollsk

1 Answers

1
votes

This tutorial is a life saver, I had the same problem that my host name comes with ~username. Now after adding the 'rewriteBase /~username/', works like a charm.

However, before all these, I followed a youtube tutorial by jason talking about how to configure cakephp on shared hosting. Just paste it here in case it helps anybody. http://www.youtube.com/watch?v=4GobWo1rIkE&tracker=False