Solved

ftp_put issue after hosting server change

Posted on 2009-07-08
3
320 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
3 Comments
 
LVL 19

Accepted Solution

by:
NerdsOfTech earned 250 total points
Comment Utility
first try:

<?php

chmod("/somedir", 0777) or die ("access denied");

?>

Open in new window

0
 
LVL 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 250 total points
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
This article discusses four methods for overlaying images in a container on a web page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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 …

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now