The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP ftp_put commands fails with APF on

Discussion in 'General Discussion' started by westhost-neil, Apr 18, 2006.

  1. westhost-neil

    westhost-neil Well-Known Member

    Joined:
    Jun 3, 2005
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    UK
    I have a customer that has a php script which FTP's a directory of images. Everything worked fine until I transferred them on to a new server.

    The server is setup almost identically to the original but the script alway fails to upload the files when APF is enabled, I've even copied the conf.apf file from the old server to the new but it's still broken.

    I use pure-ftp and this works fine with APF on.

    Any help would be greatly appreicated.

    Thanks

    Neil Westlake
     
  2. mctDarren

    mctDarren Well-Known Member

    Joined:
    Jan 6, 2004
    Messages:
    664
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    New Jersey
    cPanel Access Level:
    Root Administrator
    Make sure you clean out your iptables in case there is a rule in there blocking from setup:

    Code:
    /etc/apf/apf -f
    /etc/apf/apf -r
    That will flush then restart APF and hopefully eliminate your problem.
     
  3. westhost-neil

    westhost-neil Well-Known Member

    Joined:
    Jun 3, 2005
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    UK
    Thanks for the suggestion unfortunatley it didn't help.

    The scripts stalls for a very long time (even though the timeout is set to 30 seconds) and then reports the error:

    When I log into the remote server the files appear but are 0 size.

    Neil
     
  4. westhost-neil

    westhost-neil Well-Known Member

    Joined:
    Jun 3, 2005
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    UK
    Ok I've solved the problem with PHP's ftp_put command failing but I would like some feedback on why this works.

    In conf.apf I added 10000_65000 to the IG_TCP_CPORTS line.

    I only found this when I was testing some scripts and they kept outputting errors about failing to connect to port 41533 (port number was random but in this range).

    Is there any security risk by opening these ports?

    Neil
     
Loading...

Share This Page