Solved

ftp_put issue after hosting server change

Posted on 2009-07-08
3
333 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 250 total points
ID: 24809439
first try:

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

Open in new window

0
 
LVL 110

Assisted Solution

by:Ray Paseur
Ray Paseur earned 250 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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

634 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