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?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. gayajay

    How did my SMFs turn into EXEC files?

    gayajay, Feb 8, 2010, in forum: Mac OS X
    Replies:
    1
    Views:
    696
    Walrus666
    Feb 9, 2010
  2. irvsil
    Replies:
    0
    Views:
    547
    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:
    391
    Peter Jaros
    Jul 28, 2004
  4. harry vs
    Replies:
    2
    Views:
    590
    harry vs
    Dec 29, 2006
  5. umber

    auto-exec

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

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