Re: ftp in PHP4
| From: | Richard Lynch | Date: | Sat, 22 Sep 2001 02:26:29 +0000 |
| Subject: | Re: ftp in PHP4 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-68256@lists.php.net to get a copy of this message | ||
Does the PHP user (nobody) have read access to the local file you are trying
to upload?
Are you 100% sure you have the right things in the filenames?... Print them
out right before the ftp_puts line.
--
WARNING richard@zend.com address is an endangered species -- Use
ceo@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Chesley A Windon <windon@orthus.net>
Newsgroups: php.general
To: <php-general@lists.php.net>
Sent: Monday, September 17, 2001 3:51 PM
Subject: ftp in PHP4
> I need to have web based ftp capabilities for a site I am working on. My
> development server is running RedHat 7.1 and php-4.0.4, and I did compile
> php with the --enable-ftp switch.
>
> After reading the docs at php.net, I found a "canned" script
> (http://www.php.net/manual/en/ref.ftp.php) that I thought I would try so
> as to give me a better idea on what was involved.
>
> When running the script, I can connect to the ftp server, list the
> contents of the directory, and disconnect, but cannot upload anything.
> When I try, I get the following error:
>
> Warning: error opening /home/windon/somefile in
> /var/www/html/ftp.php on line 43
>
> line 43 reads:
>
> $upload = ftp_put($conn_id, "$destination_file", "$source_file",
> FTP_BINARY);
>
> In $destination_file I have just the filename, while in $source_file I
> have the full path and the filename.
>
> Thanks,
>
> Chesley
>