Jump to content

jkds

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jkds's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks again oni-kun, this clears it up!
  2. Thanks for the link oni-kun. I have, as you may expect, already referred to the manual page... However, the PHP manual states that the expected return should be FTP_FAILED or FTP_FINISHED or FTP_MOREDATA. I'm getting null, 1 or 2 as return values. That's the problem I was describing.
  3. Hi all, quick one: Anyone know why ftp_nb_put returns either null, 1 or 2 instead of FTP_FAILED, FTP_FINISHED or FTP_MOREDATA? I'm running the upload like this: $ret = ftp_nb_put($conn_id, $target_file, $source_file, FTP_BINARY); while ($ret == FTP_MOREDATA) { // Continue uploading... echo 'Continuing, returned '.$ret.'<br>'; $ret = ftp_nb_continue($conn_id); } if ($ret != FTP_FINISHED) { echo 'Failed, returned '.$ret; }else{ echo 'Success, returned '.$ret; } ...and I'm getting return values 2 for FTP_MOREDATA, 1 for FTP_FINISHED and null for FTP_FAILED. Any ideas?
  4. I'm up to my ankles in zombies here... anyone?
  5. Hi all, I'm forking PHP, and creating a new MySQL connection with each child process using mysql_connect (NOT pconnect). This new connection creation method is necessary to get round the "MySQL server has gone away" issue commonly found with PHP forks. Thing is, the connections aren't closing, eventually resulting in a "Too many connections" error. The "show processlist" command displays lots of connections with the command showing as "Sleep". Each child process ends with the following code: //close the connection mysql_close($childconns[$connid]); //end child posix_kill(getmypid(),9); exit(); ..but to no avail - the connection remains open. I've reduced the wait_timeout variable in MySQL to 300, which solves the problem. BUT some of these child processes may take a long time (like, 20 minutes plus... they're FTP uploads), and so will lose their database connection (I assume). So my question is: can anyone help me kill my PHP children?! Thanks! PS. Apologies if this is posted in the wrong place - bit of a cross-forum issue...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.