SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2006
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP System() call a Perl Script Return Code 13 ?

    hi there,

    I run into major problem here and I still cant get it resolved ?

    I tried to execute a perl script using the PHP system call

    This is The Code

    ======================================================
    $haha = system('perl /home/testing/cron_scripts/generate.pl', $retval);

    echo "Haha is $haha<br>";
    echo "Ret Val is $retval<br>";
    =======================================================

    The problem is I keep getting $retval = 13 ? But if I were to run them from Command line it works. However the script will take sometime. I am not sure if 13 means the code is running or something ? But the problem is my PHP script just exit !

    THanks.. Hope someone could help me out here. What does the 13 return value means actually ?

  2. #2
    SitePoint Enthusiast spamonkey8's Avatar
    Join Date
    Feb 2006
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would try shell_exec() if possible. You might also check to be sure that perl is in the system PATH variable or that you specify the absolute path to perl so that you're not just getting a 'not found' error.

    PHP Code:
    $haha shell_exec('perl /home/testing/cron_scripts/generate.pl');

    echo 
    "Haha is $haha<br>"
    Cheers!


Bookmarks

Posting Permissions

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