Hi All,

This is the first time I'm working with FTP functions in PHP. I have to create a link to send a .sql file to another server using its' FTP logins.

I used ftp_put() function in the following way

ftp_put($connection, $file_name_1, $file_name_2, FTP_ASCII);

It works perfectly in my localhost. I'm using XAMPP 1.7.3. It includes Apache 2.2.14 (IPv6 enabled) and PHP 5.3.1.

But in the server it gives following 2 warnings.
Warning: ftp_put() [function.ftp-put]: listen() failed: Permission denied (13) in <php file name> on line 47

Warning: ftp_put() [function.ftp-put]: TYPE is now ASCII in <php file name> on line 47 resource(54) of type (FTP Buffer) bool(true) bool(false)

(Line 47 contains the ftp_put function call)

The server that I'm using to host the site, contains PHP 5.2.12. I couldn't find the Apache version in the server. :(

Please can anyone help me out with this problem :( ?

Thanks a lot for taking your time to read this...


Recommended Answers

All 3 Replies

:( :( :'(

It's rather obvious to me that you don't have permission to use whatever port you're trying to use. It works on your localhost because you have root permissions and I'm pretty sure you'll need root access to make it work on the server as well. I don't exactly know how to fix it, but I'm sure a little search on Google could provide the answer. So instead sitting on your butt waiting for an answer and using smileys to cry about it, you could have been spending the last 24hrs to do some research and learn why it's not working.

Thinking twice, another possibility is that you don't have permission to use one of the files.

Hi Encrypted,

I did some search on Google and found out nothing about my error. Actually connecting to the server using FTP logins works perfectly. Only ftp_put gives me the error.

Anyway Thanks a lot for the reply. I will check whether that I'm getting the warnings just because of not having root permission or not.

Thanks again


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.