I have been learning how to use FuelPHP for a couple weeks now and have been able to run migrations fine when using mamp but I have recently moved over to FortRabbit and after getting everything setup I get the following errors when running oil r migrate
Uncaught exception PDOException: SQLSTATE[HY000] [2002] Operation timed out
for some I reason I can't connect, I have tried using every host I know of, and I can't set any permissions(mySQL Workbench).....can someone please help?
It's probably a question you have to ask FortRabbit.
It just means your PDO driver can not connect to the database. If the database is on the local machine, it could be that it looks for the socket file in the wrong location, with something like:
Yeah, it's confusing the heck out of me because mySQL Workbench connects to the DB just fine!? I submitted a support message before I posted on here so hopefully I won't have to wait to long for an answer. Thanks for your help.
I just tested on my virtual host and I get the same errors as using FortRabbit? I'm so close to saying screw this, it's been 2 days and I still can't get this to work. I love this framework so much which makes this even more frustrating.
I don't know if you need to install mysql, I don't know what FortRabbit is and what they supply.
In case you work locally, it depends on what you use. One of the common problems in environments like WAMP and MAMP is that they haven't taken the commandline into account, and the php config is in a non-standard place. Which means that php-cli (which is used by oil) doesn't have to correct php.ini settings, which in turn can cause database connection problems.
What are you using to run your virtual host? Because I have never seen this issue, both with a local MySQL and a remote MySQL.
Same is probably true for container based hosting providers.
that would be so great of you! It won't even run on Mamp anymore and I am doing the same setup every time. I put the unzipped files where I want them, and cd into the directory run composer update and change all the configs, and nothing....I tested some other apps that use PDO and they connect fine on the virtual host, I didn't bother with FortRabbit(cloud hosting). Thanks for your time on this one Harro, I really really appreciate man. I just spent like $70 bus on FuelPHP books, video lessons, and the hosting. I have worked with a couple other frameworks, even Laravel 4 but I like using this one the most and now that you can control all packages with composer is a bonus.
Apart from the fact that your config didn't autoload the Orm package (so your article controller gave a fatal error), everything runs fine here. I ran the migration using oil to create the articles table, and after that no problem with the controller.
So, good news is that there's nothing wrong with the framework, and there's nothing wrong with your code.
Bad news is that we still don't know what the problem is.
If you're on a Mac, you can also try to replace "localhost" by "127.0.0.1" in your db config. Some setups don't like "localhost", as it is actually an illegal hostname according to the RFC.
Sorry Harro I didn't see your post till just now. I started to fidget with my apache and virtual hosts files which wasn't allowing me to use localhost with my PDO connection(localhost:3306 or 127..0.0.1:3306) so I completely wiped out my computer and installed mavericks again because I wanted there to be no issues whatsoever. After I re-installed mavericks my config files went back to normal and my ssh tunnel started to connect but it wouldn't read mySQL. I changed the database config in Fuel to 'persistent' => false and everything worked fine after that.