Deploying to heroku

edited February 2018 in Feature Requests

I am wasting a bunch of time trying to connect to an external mysql db from a heroku environment.

I did the following task previously to deploy:

1. Where the mysql DB is located, i did Enable the remote mysql connections from
2. Did add the DB: heroku config:add DATABASE_URL=mysql://user:pass@server:port/database_name
3. Add the the temporal url to the environments.php file and properly setup the db config string:

$db_url = parse_url(getenv("DATABASE_URL"));
$db_server = $db_url["host"];
$db_username = $db_url["user"];
$db_password = $db_url["pass"];
$db_db = substr($db_url["path"],1);

Any suggestions? Thanks!


  • edited 11:08AM
    This doesn't sound like a FUEL related issue but more of a database connection issue. To rule out FUEL, I'd create a test script:
  • Can you get an SSH connection to your server? Does CLI access via the mysql command work?
  • edited 11:08AM
    Hi! THe DB issue was fixed. The error was about a mistake over the "production" base url.
    That was solved.

    Now the problem is something about htaccess rewriting urls and paths because the website is deployed under an "app" folder. But trying to change the INSTALL_ROOT to "/app/fuel" and/or using Rewritebase to /app/ the website doesn´t work.

    Check the url again to see the error.

    I have ssh access.

    Thanks !!
  • edited 11:08AM
    I´am trying to put to work this stuff ! :)

    The heroku env have a bootstrap file that initializes the Apache server:

    I think the problem is with the HEROKU_APP_DIR and DOCUMENT_ROOT. When I access trough the bash i can see the traditional fuelcms folder structure, but i can go up one level and all these folders are under an "app" folder:

    -- fuel
    -- assets
    -- index.php
    -- .htaccess
    -- etc

    I think the problem is between .htaccess and that app folder. I did a lot of tests adding a apache conf file setting the documentRoot to "app/" but without success.

  • edited 11:08AM
    What is the error you are seeing?
  • edited 11:08AM
    Forbbiden page (404) is the error.

    But the 404 error i´am getting is the provided by the framework. So, this is working well.

    I think the error is here: ( when the router is going to search the view ) so he is showing the codeingiter 404 default page.


  • edited 11:08AM
    What's the URL you are trying to get to? Is it the fuel admin (e.g. /fuel)? If so, do you have the fuel/application/config/MY_fuel.php $config['admin_enabled'] = TRUE? Also, does your server support .htaccess and mod_rewrite? One way to check would be to use index.php/fuel instead.
  • edited 11:08AM
    Yes, i´am trying and Yes, i´am trying .

    It supports htaccess and mod_rewrite.

    admin_enabled is set to "true".

  • edited 11:08AM
    It does indeed appear to be hitting the framework side of things and is returning a CI 404 error which looks like it is getting hung up in the fuel/codeigniter/core/CodeIgniter.php file somewhere.

    Are you able to deploy a regular CodeIgniter website?
  • edited February 2018
    Yes, here is an example:

    In the above example, i can see now the "system" folder is at the root level of the folder structure.

    May be the issue is it?
  • edited 11:08AM
    Tough to say. Are you able to debug the CodeIgniter.php file to see what where it's hitting the 404 error?
  • edited 11:08AM
    Sure. What do you have in mind?
  • edited 11:08AM
    Well, one way would be to simply put in exit(); commands at different parts of the CodeIgniter.php file to see where the show_404() is being called.
  • edited 11:08AM
    SOLVED: I did enable the error logging and could appreciate my migration to Fuel 1.4 was incomplete! ( renaming to uppercase first some controllers and models filenames )

    Fixing that...did work like a charm!
Sign In or Register to comment.