Link to home
Start Free TrialLog in
Avatar of ussher
ussherFlag for Japan

asked on

ftp_put issue after hosting server change

This install script used to work fine on my old server, however not working on the new one.

The errors start at ftp_put then continue throughout the script.  

The key seams to be that the IF statement is not returning the same output as on the previous server.  I think this because the ftp_put IS causing the file to be written to the expected location.  If i remove conditional IF statement and just hard code the ftp_put, the file gets written, but then triggers the error on the ftp_delete  in the following line.

On the old server the instructions said to "chmod the directory to 777" but on this new server that causes an "Internal Server Error" and must stay at 755, but its still possible to write.

I don't have 'root' access to this server.  Ideas as to how to fix it so the install script will work please.
if (@ftp_chdir($conn_id, $basedir) === FALSE)
	error("can not change directory to: $basedir");
if (!@ftp_put($conn_id, $tempfile, $temppath, FTP_ASCII)) 
	error("can not write to file: $tempfile.");
 
if (!ftp_delete($conn_id, $tempfile))
	error("could not delete: $tempfile. ");

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of NerdsOfTech
NerdsOfTech
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ussher

ASKER

Thanks for the help Guys, Im going to remove the FTP part of the code and approach everything from a different angle.  So although i didnt find the solution, im not looking for it anymore.  Split the points to close the question.