Exec() & System() not Working?

Discussion in 'Programmer Misc' started by VikR, Nov 10, 2010.

  1. VikR

    VikR Guest

    When executed from the terminal, the following command works
    perfectly:

    gnuplot '/Applications/IPG/htdocs/ftp/company_name/Charts/
    gnuPlotCommandFile.gp'

    However, when I run it from inside PHP with:

    exec("gnuplot '/Applications/IPG/htdocs/ftp/company_name/Charts/
    gnuPlotCommandFile.gp'");

    ....or:

    system("gnuplot '/Applications/IPG/htdocs/ftp/company_name/Charts/
    gnuPlotCommandFile.gp'");

    ....nothing seems to happen. How can I correct this?

    Note - exec is enabled on my system, according to the following
    function:

    function exec_enabled() {
    $disabled = explode(', ', ini_get('disable_functions'));
    return !in_array('exec', $disabled);
    }

    Thanks very much in advance to all for any info.
     
    VikR, Nov 10, 2010
    #1
    1. Advertisements

  2. VikR

    VikR Guest

    Thanks very much for your help. It's working now. Code currently being
    used:

    $shellCommmand = "/usr/local/bin/gnuplot '" . $pathToCommandFile .
    "'";
    $output = system($shellCommmand . " 2>&1");
     
    VikR, Nov 10, 2010
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. gayajay

    How did my SMFs turn into EXEC files?

    gayajay, Feb 8, 2010, in forum: Mac OS X
    Replies:
    1
    Views:
    663
    Walrus666
    Feb 9, 2010
  2. irvsil
    Replies:
    0
    Views:
    507
    irvsil
    Aug 12, 2010
  3. Peter Jaros

    GDB: "tcsh: exec: Badly formed number."

    Peter Jaros, Jul 28, 2004, in forum: Programmer Help
    Replies:
    0
    Views:
    360
    Peter Jaros
    Jul 28, 2004
  4. harry vs
    Replies:
    2
    Views:
    566
    harry vs
    Dec 29, 2006
  5. umber

    auto-exec

    umber, Jan 5, 2005, in forum: Programmer Misc
    Replies:
    3
    Views:
    387
    Miro Jurisic
    Jan 6, 2005
  6. cannot exec cc1

    , Aug 3, 2006, in forum: Programmer Tools
    Replies:
    1
    Views:
    474
  7. Rocky
    Replies:
    7
    Views:
    153
    Your Name
    Jul 21, 2010
  8. Roger Merriman
    Replies:
    1
    Views:
    179
    Sara Kirk
    Sep 23, 2005
Loading...