Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Running Oil on Dreamhost
  • Has anyone had success running Oil on Dreamhost? I have a dedicated server with them and am running the following command via cron:

    /usr/local/php53/bin/php /home/myuser/oil r queue

    The result of which is:

    [0;31m2002 - SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in COREPATH/classes/database/pdo/connection.php on line 94[0m

    I can run the script locally just fine. I've ssh'ed into the account and tried to run the above oil command, but received the same error. 

    Thoughts?
  • run

    /usr/local/php53/bin/php -v

    to check if it's really php-cli that is used.

    After that, check which php.ini it uses. Some setups use a non-standard location for the php.ini file used by the webserver, which means the commandline version loads the wrong php.ini.
  • Hmm.... looks like it is running php-cli and is using the same php.ini

    From Command Line:
    php -v
    PHP 5.3.13 (cli) (built: Jun  7 2012 17:53:07)

    php -i
    Configuration File (php.ini) Path => /etc/php53
    Loaded Configuration File => /etc/php53/php.ini
    Scan this dir for additional .ini files => /etc/php53/conf.d
    Additional .ini files parsed => /home/domainname/.php/5.3/phprc

    Using phpinfo() from a webpage on server:
    Configuration File (php.ini) Path /etc/php53
    Loaded Configuration File /etc/php53/php.ini
    Scan this dir for additional .ini files /etc/php53/conf.d
    Additional .ini files parsed /home/domainname/.php/5.3/phprc

  • Since it's a dedicated server: is MySQL actually installed and running? And if so, is the socket file actually in /var/run/mysqld/mysqld.sock (check your /etc/my.cnf)?
  • Found the solution. It had to do with the FUEL_ENV not being set using htaccess when running from the command line.  Fixed this by setting it during the command via:

    env FUEL_ENV=staging /usr/local/php53/bin/php /home/domainname/oil r queue
  • Ah, you didn't mention an environment change. ;-)
  • Haha, didn't even occur to me that the environment in CLI mode would change. In hindsight, it is a silly mistake on my part.
  • If you run 'oil -v', it will tell you which environment is used.

Howdy, Stranger!

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

In this Discussion