Top VPS Hosting Provider

Welcome to the myhosting.com Forums.
+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Anni is offline Junior Member
    Join Date
    May 2012
    Posts
    4

    Default Permission problem: PHP function ftp_connect not enabled?

    Hi there,

    I'm trying run a Contao Web CMS www.contao.org on a Business Hosting and Email account.
    The installation fails because Contao is not able to modify files by itself, so the configuration file is not writable. (this should be a permission problem). I think this problem is also well-known from Wordpress, especially when trying to install plugins.

    The official solution is, providing FTP connection data for Contao. I did this many times, it's the best working solution for all webhosters i've tried so far. But not now

    I asked for help in the german Contao support Forum and just got to know, that the PHP function ftp_connect is not enabled on myhosting.com (or some account types) Is that true???

    Enabling this funtion might solve my problem. I already tried to contact the support via ticket - but my ticket disappeared and never got answered. Phone support also wasnt very helpful, i wasted my time explaining, that i'm not talking about a FTP connection using my desktop client! (i have no problems doing that, btw)

    Error message in browser window:
    Code:
     Fatal error: Uncaught exception Exception with message Could not connect to the FTP server thrown in /usr/local/pem/vhosts/113951/webspace/httpdocs/mydomain.biz/system/libraries/FTP.php on line 104
    Is there anyone who has an idea how to solve this problem? I would be so... )))))))))

    Many thanks, Annika

  2. #2
    suwunk is offline Super Moderator
    Join Date
    Aug 2010
    Posts
    1,083

    Default

    Hi Annika,

    I've submitted your problem to myhosting staff. I hope that they will help you as soon as possible.

    Cheers

  3. #3
    tima is offline Administrator
    Join Date
    Apr 2008
    Posts
    191

    Default

    Hi There,

    Can you clarify if you're on a Windows or Linux shared hosting? Our Business plan comes in both "flavors".
    Tim Attwood
    Product Manager
    myhosting.com

  4. #4
    tima is offline Administrator
    Join Date
    Apr 2008
    Posts
    191

    Default

    I've tested with both Windows and Linux shared hosting and it does seem to fail on both. I'm still looking into the issue and discussing some ideas internally. I will try to get back to you soon with more info. In the meantime, it would still be helpful to know if you're on Linux or Windows
    Tim Attwood
    Product Manager
    myhosting.com

  5. #5
    tima is offline Administrator
    Join Date
    Apr 2008
    Posts
    191

    Default

    Just an update: ftp_connect itself should function. The issue is that we do block outbound FTP from the server, so this is why it will fail. This was done for various security reasons, like preventing abuse by script-kiddies using our servers for scanning.

    It is possible that it could be opened up, but it's problematic because FTP is a fairly messy protocol requiring many ports.
    Tim Attwood
    Product Manager
    myhosting.com

  6. #6
    Anni is offline Junior Member
    Join Date
    May 2012
    Posts
    4

    Default

    Hello Tim,

    many thanks for the support! I'm not sure, if it's really the ftp_connect function, but a user in the german Contao forum came up with that idea - he had the same problem 3 years ago, but obviously it was solved - his website is still running on myhosting.com. He just didn't anwer when i asked how to do that

    PHP Version 5.2.17
    System Linux linweb01.caex.com 2.6.18-274.3.1.el5 #1 SMP Tue Sep 6 20:13:52 EDT 2011 x86_64


    The CMS is located in a subfolder of webspace/httpdocs. I created a wildcard subdomain (for testing purposes) and a FTP user pointing to that directory. This is also the FTP user a wanted to use for Contao - but i tried the root FTP user as well.


    If you send me a PM to reply, i could also send you the link to domain & check tool.


    Best regards, Annika

  7. #7
    tima is offline Administrator
    Join Date
    Apr 2008
    Posts
    191

    Default

    Hello Annika,

    Can you explain what the FTP function does with this CMS? Describing a valid use-case might help convince us to open up the port(s) on the firewall.
    Tim Attwood
    Product Manager
    myhosting.com

  8. #8
    Anni is offline Junior Member
    Join Date
    May 2012
    Posts
    4

    Default

    Hello Tim, i'll try to explain:

    Providing FTP data for Contao is known as the so-called "Safe-Mode"-Hack"

    Here's an excerpt from the Contao installation guide:

    ---
    The term "Safe Mode Hack" is actually misleading, because it implies that the problem was caused by the PHP safe_mode. However, it is caused by insufficient file permissions and can occur even if safe_mode is disabled, so it should be called "File Permission Hack" instead. PHP as an Apache module is typically run as wwwrun, www-data or nobody, whereas the files that you uploaded via FTP belong to you (e.g. web4 or ab5678). The server therefore denies the PHP script Contao access to those files.

    To work around the permission problem, Contao establishes an FTP connection to modify files and folders. All you have to do is to enter your FTP login details in the local configuration file (system/config/localconfig.php).
    ---

    A typical case for modifying files occurs, when installing plugins from the extension repository.
    The most important file to write in is the localconfig.php, which is similar to the wp_config.php in Wordpress, or settings.php in Drupal. Contao and many plugins use that file to store their settings. Changing settings won't be possible without write permission.

    The localconfig.php also collects all data entered during the installation process. After a successful installation, it contains the database connection data, the ftp-connection data, install password (encrypted) and some website-specific data like title or version number.

    Another case might be: creating folders and upload files with the file manager. Contao creates cache files of every uploaded image, which also requires write access to a temp-folder.

    I hope this was helpful for the decision

    Best regards, Anika

  9. #9
    tima is offline Administrator
    Join Date
    Apr 2008
    Posts
    191

    Default

    Hi Annika,

    Can you try this once again? Even though FTP is blocked (outbound) on the firewall, if you are making the ftp connection locally (i.e. to your own hosting account) it should work.

    I have a simple test script on another account on the same shared hosting node, and it is currently functioning properly.
    Tim Attwood
    Product Manager
    myhosting.com

  10. #10
    Anni is offline Junior Member
    Join Date
    May 2012
    Posts
    4

    Default

    Tim!! It works!!!

    I could complete installation and everything works as intended. I can upload files and change settings...

    Many thanks for the help! Have a nice day.

    Regards, Anni


 

Similar Threads

  1. how disable and enable function
    By didoex in forum Virtual Server
    Replies: 4
    Last Post: 2012-02-22, 01:29 PM
  2. wordpress problem. Help!
    By tunak in forum Troubleshooting
    Replies: 1
    Last Post: 2011-10-15, 11:04 PM
  3. VPS - Problem
    By gsempir1 in forum Troubleshooting
    Replies: 1
    Last Post: 2010-10-13, 02:29 AM
  4. permission
    By Randy5 in forum Beginners
    Replies: 0
    Last Post: 2010-08-13, 10:04 AM
  5. boot problem
    By WrigleyF in forum Troubleshooting
    Replies: 0
    Last Post: 2010-08-12, 10:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts