I have tried to connect to ftp server it windows. It works well with. But when I used the same with red hat i was unable to connect to server.
ftp service is already running in redhat.

 $con_id=ftp_connect("192.168.0.8")or die("Couldn't connect to"); ;

 $login_result = ftp_login($con_id, "newuser", "wampp");
// check connection
if ((!$con_id) || (!$login_result)) {


       echo "connection has failed!";

   } else {
       echo "Connected to $ftp_server, for user ".".....";
   }

Is it that the FTP server is running on RedHat Linux?

Have you tried connecting with an ordinary FTP client to test whether user exists and the password is set OK? Do you get a warning form PHP (frp_login should issue a warning if returns false).

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.