|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-09-10 22:46 UTC] l_faillie at yahoo dot com
Description: ------------ Hi all, I'm working on a script to update a web site using ftp_* functions using CLI version of PHP. Unfortunatly, it doesn't work because all calls to ftp_put() fail w/o anything displayed. There is also some ftp_chdir() and ftp_pwd() in my script and they work correctly : the problem is only w/ ftp_put(). I have added some puts() inside php's code, made some checks and I think the problem comes from the scripting engine as PHP_FUNCTION(ftp_fput) of ext/ftp/php_ftp.c is never called. I think also it's related to my own compilation environment under Solaris 8 because I build PHP on my HP-UX 10.20 workstation at work and I don't have this bug. Questions : - does someone know if there is issue w/ Solaris 8 or 1 year old GNU tool ? - where can I put breakpoint using gdb to know what's append just before ftp_put is called ? Thanks for your help. Laurent PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 23:00:01 2025 UTC |
Sample source code : #!/usr/local/bin/php <?php /**** * Parametres de connection ****/ // Pour RA $usr = 'le_user'; $pwd = 'le_passwd'; $srv = 'ra.chez.moi'; $sroot = '/web'; /**** * Ouverture du FTP ****/ $con = ftp_connect($srv) or die(1); ftp_login($con, $usr, $pwd) or die(1); ftp_chdir($con, $sroot) or die(1); echo '*D* Le repertoire courant est :', $home = ftp_pwd($con), "\n"; $fch='galerie/Italie/LacMajeur/Baveno/index.php' $dir = dirname($fch); $ndir = substr_count($dir,'/')+1; ftp_chdir($con, $dir) or die(1); echo ftp_pwd($con),' & ', getcwd(), basename($fch),"\n"; ftp_put($con, basename($fch), basename($fch), FTP_BINARY) or die("*F*pb de put\n"); ftp_close($con); echo "C'est fini !\n"; ?> Bye