title: trying to connect to local server using php (ftp_connect)
body: <p>I have a server set up with Apache2 on linux and I'm trying to upload a file to that server.</p>
  
  <p>I am using:</p>
  
  <pre><code>$conn = ftp_connect("localhost") or die("Server connection failed.");
  </code></pre>
  
  <p>to achieve this, though it is not working.</p>
  
  <p>I have tried a "wget" command to the same server though that failed also with this response:</p>
  
  <pre><code>Resolving localhost (localhost)... 127.0.0.1
  Connecting to localhost (localhost)|127.0.0.1|:21... failed: Connection refused.
  </code></pre>
  
  <p>Does anybody know how to allow my server to be used in the ftp_connect php command?</p>
  
  <p>Thank you very much guys.</p>