Hi,
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 %.herokuapp.com
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!
Comments
http://php.net/manual/en/function.mysqli-connect.php
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 !!
The heroku env have a bootstrap file that initializes the Apache server:
https://github.com/heroku/heroku-buildpack-php/blob/master/conf/apache2/heroku.conf
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:
app
-- 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.
Thanks!
But the 404 error i´am getting is the provided by the framework. So, this is working well.
I think the error is here: http://docs.getfuelcms.com/general/opt-in-controllers ( when the router is going to search the view ) so he is showing the codeingiter 404 default page.
URL: enigmatic-anchorage-61301.herokuapp.com
Thanks!!
It supports htaccess and mod_rewrite.
admin_enabled is set to "true".
Thanks!
Are you able to deploy a regular CodeIgniter website?
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?
Fixing that...did work like a charm!