PDO Usage from Command Line

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • paradiselost
    Member
    • Apr 2004
    • 31

    PDO Usage from Command Line

    I'm trying to run a PHP script from the command line that utilizes PDO and I get this error message:

    Code:
    Fatal error: Class 'PDO' not found in /path/to/my/file.php on line 365
    This file works fine if called via HTTP, but I get this error when running the file with PHP in the command line like this:

    Code:
    php cron.php
    Is this a limitation of the command line version of PHP that Dathorn has set up, or do I need to tell my script where PDO is? If this is a limitation, are there any workarounds?

    Thanks,

    James
    --
    ** DEVTRENCH **
    --
    James Ehly
  • AndrewT
    Administrator
    • Mar 2004
    • 3653

    #2
    Please submit a ticket and include the path of the script that you are executing as well as the account's SSH login info so that we can take a look.

    Comment

    • geronimo
      Junior Member
      • Apr 2004
      • 4

      #3
      I'm also using PHP CLI and getting this same error.

      Fatal error: Class 'PDO' not found in /home/
      What was the solution?

      Comment

      • AndrewT
        Administrator
        • Mar 2004
        • 3653

        #4
        Please submit a ticket concerning this. The jailshell environment does not have access to the modules, etc. that are necessary for this to work. We will have to copy them over to the account that you wish to run this on and you will have to utilize a custom php.ini via the CLI. Alternatively, you can run the script via cron and this won't be an issue.

        Comment

        Working...