550 Failed to open file

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

Are you new to LinuxQuestions.org? Visit the following links:
Site Howto | Site FAQ | Sitemap | Register Now

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux — A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter. For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author’s experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

In PHP, you have wrappers for ftp and ftps to allow you access files on an FTP using fopen.

Читайте также:  I love economics ru

I want to use the wrapper to download a file as a stream.

My simplified code:

Error:

Warning: fopen(ftp://. @server.com/directory-with-dash/file.mp3): failed to open stream: FTP server reports 550 /directory-with-dash/file.mp3: The system cannot find the path specified. in /var/www/ftp.php on line 4

More Info:

  • The same url works fine when used with wget on the same machine.
  • Using PHP’s FTP extension to download files works fine
  • FTP server responds with 220 Microsoft FTP Service and 215 Windows_NT
  • FTP server can handle passive mode
  • Using filesize($url); results in Warning: filesize(): stat failed for.
  • allow_url_fopen setting is On
  • The same code worked fine against a different FTP-server, 215 UNIX Type: L8

What might be causing the problem?

Edit:

I have noticed that the Microsoft FTP Service doesn’t place you in the root folder when you connect to the FTP, but in a subfolder:

This subfolder must not be in the URL when you use wget or a web browser:

I have tried both urls in the PHP-code, but I get the same error still. (I typed it wrong)

Want to improve this question? Update the question so it’s on-topic for Server Fault.

Closed 4 years ago .

I’m trying to copy a website using the ftp connection. Some files fail to arive to my computer. They seems to exist on the server but i can’t copy them. It is about some html and php files. When I try to read them i get a ‘550 failed to open file error’. Same 550 error appears when i try to delete it using my ftp connection.

The real problem is not about the fact that I can’t copy those files. The problem is that an antivirus consider my website as infected and blocks the acces to it. I’ve copyied the same website to another server and it is not blocked. Also, when the website runs from my localhost server, the antivirus doesn’t report any problem. Other websites from that server don’t have this problem. The only difference is those files that I can’t copy or view.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *