101 reputation
2
bio website pdobson.com
location Warren, OH
age 28
visits member for 3 years, 6 months
seen Jan 7 '13 at 18:04

Dec
12
awarded  Supporter
Mar
1
awarded  Autobiographer
Jan
17
comment FTP Upload works from local command line / remote GUI client but not from PHP script
I thought this was the problem too, but it turns out that the FTP module in PHP actually sets a different user using it's FTP_login method. So while that particular object was being executed as 'www-data', the FTP functions were actually being executed as 'ftpuser' as shown in the log files. The problem was that the Joomla's FTP user couldn't find the directory it was supposed to write too because it was jailed to it's home directory, and was trying to write to it's home directory using an address from the root directory.
Jan
17
comment FTP Upload works from local command line / remote GUI client but not from PHP script
Ok, I discovered the answer. It wasn't a permissions error, as a 550 typically is. It was a "Directory not found" error. The home directory for ftpuser was the public_html directory for the Joomla site. So when Joomla was trying to write a file to it's home directory, it was using the address from the root directory - so it was using the directory address twice - e.g. "/address/from/root/address/from/root" instead of just "/address/from/root". I changed the directory Joomla was trying to write to from "/address/from/root" to "/" and it PUT the file to the desired directory.
Jan
17
asked FTP Upload works from local command line / remote GUI client but not from PHP script