Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ftp_put issue after hosting server change

Posted on 2009-07-08
3
Medium Priority
?
334 Views
Last Modified: 2013-12-13
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

0
Comment
Question by:ussher
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 19

Accepted Solution

by:
NerdsOfTech earned 750 total points
ID: 24809439
first try:

<?php
chmod("/somedir", 0777) or die ("access denied");
?>

Open in new window

0
 
LVL 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 750 total points
ID: 24815578
Consider removing the @-sign notation - you would want to see the PHP notices and messages when you are debugging this issue, right?
0
 
LVL 1

Author Closing Comment

by:ussher
ID: 31601045
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.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question