Results 1 to 6 of 6
  1. #1

    Post suPHP not creating background exec()

    We recently upgraded all of our fleet to suPHP, and we have encountered a problem with alot of clipshare/vshare scripts out there.

    After alot of debugging it turns out its due to suPHP isn't allowing background processes from exec() , it does kinda, but it doesn't like it when the script is modified, like if variables passes through a script, as soon as those variables are gone from the script it was called from , the BG process dies immediately, so soon as the script calls it, and ends the variables, it dies, so it didn't give time to do the conversion or even placed the script in the background to run.

    I am stuck to what could be causing.

    Here is a quick way to reproduce the problem:

    Lets say you have a script named testbackground.php

    Inside I have:


    <?
    exec("/usr/bin/php /home/USERNAME/public_html/convert.php 331.avi 331 /home/USERNAME/public_html/video/331.avi > /dev/null &");
    ?>

    This properly works if I run it in the browser, it immediately gives me a whitepage, and using top -uUSERNAME I can see the background process working.

    But if you quickly edit the same script, testbackground.php , and comment the exec() line to:


    <?
    #exec("/usr/bin/php /home/USERNAME/public_html/convert.php 331.avi 331 /home/USERNAME/public_html/video/331.avi > /dev/null &");
    ?>

    As soon as you hit save, like via nano, etc, the background that was previously running, it immediately dies.

    I am stuck to what could be causing this.

    I pictured it was due to MTP from Apache2, but I disabled it, and still causes it.

    If you believe you can fix this, or have a solution to the above, please PM me, I will pay you generously for your time.

    Thanks!

  2. #2
    Join Date
    Dec 2003
    Posts
    936
    Cannot PM you as you have 0 posts
    Please contact me
    Primary email: advanced dot programmer at gmail dot com ..

  3. #3
    Join Date
    Apr 2007
    Location
    US, UK, Europe, ME
    Posts
    258

  4. #4
    Still looking for someone to assist with this.

    We really need a PHP developer we believe, if you believe you can fix the above issue, please let me know.

    What turns out to be the issue in the end now is that PHP in cgi mode when the parent dies, it kills the background process as well.

    Its not possible yet to create a PHP background process to make the ClipShare conversion.

  5. #5
    Join Date
    Jan 2005
    Location
    Chisinau, Moldova
    Posts
    10
    try it with nohup.

    $10 for the tip.

  6. #6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •