Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Initial Database Setup
  • First off, I'm really looking forward to using FulePHP... but I can't until I get this figured out. I've followed the manual, and several tutorials and and always found the same problem. First off, I'm running on OS X 10.8.4 with a home brew build of apache/php/mysql and haven't had any issues with the Codeigniter framework.

    When I run the migrate function I get: This

    Here is my db.php file. I have checked and I do have mysqli, and my php command is the terminal default (not to be confused with the osx installed version). I have used the terminal 'mysql -u fwporta -p' to prove that the credentials are correct.  The port is open... I don't know what else it could be.

    I have even tried using my postgres database and am also getting an error there too. 

    Let me know what info you need to diagnose this... I'm at a loss...
  • If I read the comments in that db.php correctly, you've changed the global db.php  (which is in app/config), and not the environment db.php (by default app/config/development/db.php).

    Since both are merged on load, your settings are overwritten by the ones in the environment file.

    The way config files are loaded and merged in this order:
    - fuel/core/config
    - package config (if applicable, from any loaded package)
    - package config/<environment> (if applicable, from any loaded package)
    - app/config
    - app/config/<environment>
    - module config (if applicable)
    - module config/<environment> (if applicable)

    Say all these locations have a config file called db.php, then all of them are loaded (in this order) and merged. So you'll see that "app/config/<environment>" will be merged on top of "app/config", so anything in there will overwrite what was already loaded.
  • Yes the config file in question is located in '/fuel/app/config/'. Odd... when I changed the file, for 
    example from mysqli to plain mysql the error message changes accordingly. I have updated the the development/db.php file and still getting the same error message. 

    Thanks for the info. I see your point, after changing the '/development/' file, I noticed it did take precedent over the '/config/' file. And still no joy :-(

  • Correct. The idea is that you put generic (= not-environment specific) configuration in app/config, and use the environment folders to override that.

    That works for every config file. I have for example email config files in every environment, because my different server environments use different from- and to addresses...
  • Well I've just setup a VM with an Ubuntu LAMP stack and it worked fine... So It must be some incompatibility with OS X. Again, I've used PHP and MySQL on this box before. I'm leaving this question unanswered in case someone has an idea they want me to try. I would like to get it working on my main development box.
  • On OS-X you can also have the problem that the commandline PHP uses a different php.ini from the one your webserver is using, causing stuff (for example PDO drivers) to be missing.
  • I'm making all my dev on OSX. The only issue I've been tackling is the fact that my install of OS X is char insensitive so MyClass.php has to be myclass.php in order to run on other systems.

    Regarding your issue, did you install homebrew ? If no, then do it and use it to setup a fully set of PHP to be used by your Apache.

    An other option is to setup a full (Apache + PHP + MySQL) install that do not rely on the one provided by Apple.

    In both case, make sure your $PATH is set properly so you're calling the right php.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion