Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

FTP not connection at script level

Discussion in 'Data Protection' started by durangod, Feb 3, 2018.

  1. durangod

    durangod Well-Known Member

    Joined:
    May 12, 2012
    Messages:
    365
    Likes Received:
    17
    Trophy Points:
    68
    cPanel Access Level:
    Root Administrator
    Hi,

    I switched from proftp to pureftp and ever since then i cannot connect using my ftp at script level. I was able to get filezilla working, however at script level (such as a wordpress level) it wont connect. I dont use wordpress, i use another software however im sure its probably a similar issue with all script level issues, so i have been looking at the wordpress forum to see if i can find something to try to get my program to connect.

    My program allways connected before fine on proftp, im not sure what the issue is. But i have tried everything i know how to do, i have used the localhost, the ftp.example.com, the hostname.example.com, no port at all because pureftp is passive, i have tried everything.

    Today i ran into this little bit of code that seems to help wordpress users connect if its broken but dont know what it does.

    Can someone please explain this to me before i try it?

    I know that it changes the permission but why would those permissions fix the issue. I am not understanding the www-data- and /var/www relationships i guess.

    And do you have any suggestions what i might try next?

    Code:
    chown -R www-data:www-data /var/www
    find /var/www/ -type d -exec chmod 755 {} \;
    find /var/www/ -type f -exec chmod 644 {} \;
    
    thanks :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #1 durangod, Feb 3, 2018
    Last edited: Feb 3, 2018
  2. durangod

    durangod Well-Known Member

    Joined:
    May 12, 2012
    Messages:
    365
    Likes Received:
    17
    Trophy Points:
    68
    cPanel Access Level:
    Root Administrator
    OK so i ran a script to test the connection at site level in the same folder..

    and it came back as this

    never seen that before...

    so then i did the connection using this format adding ftpes://

    Code:
    host : ftpes://domain.com
    
    and i get this

    this is that line

    Code:
            $con = ftp_connect($host, $port, $timeout);
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #2 durangod, Feb 3, 2018
    Last edited: Feb 3, 2018
  3. durangod

    durangod Well-Known Member

    Joined:
    May 12, 2012
    Messages:
    365
    Likes Received:
    17
    Trophy Points:
    68
    cPanel Access Level:
    Root Administrator
    GOT IT !!! in WHM under ftp server config i changed the TLS encryption support to optional. And using the main cpanel user i can use the ftp at site level.

    However, if i create a new ftp account, even when i assign them to the public_html, it comes back and tells me they dont have permission to change files.

    So how do i fix that part?

    for example if i created a ftp account for ftptest@example.com how do i give ftptest permission to update files?

    I checked who owned the files and its the domain username and not root... i always thought if the owner was the domain username that any ftp created under their umbrella also had write privileges. Is that not true?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #3 durangod, Feb 3, 2018
    Last edited: Feb 3, 2018
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Are you sure you are accessing the directory that's assigned to the FTP account, or a subdirectory beneath it? Are you attempting to download/upload files when you receive that error message, or change the permissions of the files?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice