note 119804 added to function.ftp-get
| From: | scott dot chu at udngroup dot com | Date: | Tue, 30 Aug 2016 07:23:43 +0000 |
| Subject: | note 119804 added to function.ftp-get | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-206418@lists.php.net to get a copy of this message | ||
I'd suggest use ftp_fget() instead of ftp_get() since the latter only return TRUE or FALSE and
there's no obvious way to get the cause of failure.
Using ftp_fget, you have to pass a file handle as local file, so you have to do fopen() first.
By way of this, you can find 'Permission Denied' problem when call fopen(). If you use
ftp_get(), there's no way to find this error cause.
In my case, I run httpd using 'nobody' and I create ftp local folder using
'haha'. It tooks me long time to find the 'Permission Denied' problem at that
time since I use ftp_get() then.
----
Server IP: 72.52.91.14
Probable Submitter: 60.251.132.249
----
Manual Page -- http://php.net/manual/en/function.ftp-get.php
Edit -- https://master.php.net/note/edit/119804
Del: integrated -- https://master.php.net/note/delete/119804/integrated
Del: useless -- https://master.php.net/note/delete/119804/useless
Del: bad code -- https://master.php.net/note/delete/119804/bad+code
Del: spam -- https://master.php.net/note/delete/119804/spam
Del: non-english -- https://master.php.net/note/delete/119804/non-english
Del: in docs -- https://master.php.net/note/delete/119804/in+docs
Del: other reasons-- https://master.php.net/note/delete/119804
Reject -- https://master.php.net/note/reject/119804
Search -- https://master.php.net/manage/user-notes.php