#1
  1. No Profile Picture
    <?=contributing user ?>
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    494
    Rep Power
    29

    Executing command through exec


    I am trying to run a command through exec and I am getting the response of (from exec)

    Code:
    Array (     [0] => Insufficient memory to continue the execution of the program.     [1] => Did not convert )
    Any idea how to up the limit that will allow more memory this command? I am trying to run an ms office com.

    I am using windows, php, apache
    Command runs fine on the machine itself when I run it form the command line.

    Any help is helpful,

    Thank you,
    Will
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,316
    Rep Power
    7171
    As far as I know, PHP's memory limit does not apply to programs run by exec.

    When you test it from the command line, are you running it as whatever user runs the Apache service?
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. No Profile Picture
    <?=contributing user ?>
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    494
    Rep Power
    29
    I am not really sure if I can login as system, I have not tried that. Its not a real system user.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Dec 2004
    Posts
    3,027
    Rep Power
    377
    maybe it is the script that calls exec that is eating up all the memory?
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    1
    Rep Power
    0
    It is good command to execute the code.

    Comments on this post

    • ptr2void disagrees : Oh look, another SEO spammer making worthless replies.
  10. #6
  11. No Profile Picture
    <?=contributing user ?>
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    494
    Rep Power
    29
    Originally Posted by paulh1983
    maybe it is the script that calls exec that is eating up all the memory?
    Im not sure - I upped php limit to 2 GB just for the heck of it and I dont see any consuming memory from apache that looks crazy. The script basically just calls the exec to run something...
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Sep 2006
    Posts
    2,042
    Rep Power
    535
    What happens when you run the command directly from the shell?

    Also, off topic, but be sure you look into escapeshellarg()
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Sep 2006
    Posts
    2,042
    Rep Power
    535
    I should have read your entire post first. I see you already tried to run it from the shell.

IMN logo majestic logo threadwatch logo seochat tools logo