Results 1 to 14 of 14

Thread: Manually installation

  1. #1
    New user
    Join Date
    09-23-11.
    Posts
    7

    Default Manually installation

    Our server is setup to allows only SFTP. I did upload all files, changed permissions, included FTP login credentials.

    I did configure it $GLOBALS['TL_CONFIG']['useFTP'] = true;
    and this
    $GLOBALS['TL_CONFIG']['useSFTP'] = true;
    but the installation stops with the following errors:
    ...
    Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/public_html/demo/system/config/localconfig.php:40) in /home/xxx/public_html/demo/system/libraries/Template.php on line 286

    #0 /home/xxx/public_html/demo/system/libraries/Template.php(286): __error(2, 'Cannot modify h...', '/home/xxx/pub...', 286, Array)
    #1 /home/xxx/public_html/demo/system/modules/backend/BackendTemplate.php(170): Template->output('Vary: User-Agen...', false)
    #2 /home/xxx/public_html/demo/contao/install.php(904): BackendTemplate->output()
    #3 /home/xxx/public_html/demo/contao/install.php(217): InstallTool->outputAndExit()
    #4 /home/xxx/public_html/demo/contao/install.php(914): InstallTool->run()
    #5 {main}
    Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/public_html/demo/system/config/localconfig.php:40) in /home/xxx/public_html/demo/system/libraries/Template.php on line 287

    Template.php on line 286
    header('Vary: User-Agent', false);
    Template.php on line 287
    header('Content-Type: ' . $this->strContentType . '; charset=' . $GLOBALS['TL_CONFIG']['characterSet']);

    localconfig.php:40 (password is correct)

    I did include in the localconfig.php this:
    $GLOBALS['TL_CONFIG']['useSmhExtended'] = true;
    $GLOBALS['TL_CONFIG']['useSMHClass'] = 'SMHSFTP';

    Do I have to install the unzipped extension Contao_smhextended_50009_14 and when yes where?

    Do I have to rename the .htaccess.default into .htaccess or do I have to create an empty file, which will be re-written during installation?

    Did I miss something prior installation?

    I am used to manually installation of WordPress, Joomla and Drupal, and would like to know, if this would be possible with this product as well. Auto updates/installs are usually prohibited by our server security.

  2. #2
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Manually installation

    I don't know about SFTP, but yes you would normally rename .htaccess.default to .htaccess, and manual install of modules is done by placing the unzipped module into the system/modules folder, and then logging into contao/install.php and "updating the database".

  3. #3
    New user
    Join Date
    09-23-11.
    Posts
    7

    Default Re: Manually installation

    I provided the correct login credentials, but I am not able to run the installations and get instead this error message:

    "Your server does not support file access via PHP; most likely PHP runs as Apache module under a different user. Therefore please enter your FTP login details, so Contao can modify files via FTP (Safe Mode Hack)."

    As I mentioned I have to use SFTP.

  4. #4
    Community-Moderator xchs's Avatar
    Join Date
    06-20-09.
    Posts
    1,292

    Default Re: Manually installation

    Hi eve,

    IMHO there is no configuration option
    Code:
    $GLOBALS['TL_CONFIG']['useSFTP'] = true;
    So, use the configuration variables provided by the extension author:
    Code:
    $GLOBALS['TL_CONFIG']['useSmhExtended'] = true; // this activates the extended smh.
    $GLOBALS['TL_CONFIG']['useSMHClass'] = 'SMHSFTP'; // leave this alone, only sftp possible for now.
    $GLOBALS['TL_CONFIG']['ftpHost'] = '##your hostname##';
    $GLOBALS['TL_CONFIG']['ftpPath'] = '##path on sftp server to TYPOlight##';
    $GLOBALS['TL_CONFIG']['ftpUser'] = '##your username##';
    $GLOBALS['TL_CONFIG']['ftpPass'] = '##your password##';
    $GLOBALS['TL_CONFIG']['ftpPort'] = '22';
    (http://www.contao.org/extension-list/vi ... ed.en.html)


    Regarding the warning message you get, you should check that there are no blanks, new lines or other characters after the PHP closing tag "?>" and make sure that you save this configuration file with encoding UTF-8 (without BOM)!
    Contao Community Moderator
    → Support options

  5. #5
    New user
    Join Date
    09-23-11.
    Posts
    7

    Default Re: Manually installation

    I checked for empty lines and blanks, and included this code in the localconfig.php

    ### INSTALL SCRIPT START ###
    $GLOBALS['TL_CONFIG']['useSmhExtended'] = true;
    $GLOBALS['TL_CONFIG']['useSMHClass'] = 'SMHSFTP';
    $GLOBALS['TL_CONFIG']['ftpHost'] = 'xxx';
    $GLOBALS['TL_CONFIG']['ftpPath'] = 'public_html/demo/';
    $GLOBALS['TL_CONFIG']['ftpUser'] = 'xxx';
    $GLOBALS['TL_CONFIG']['ftpPass'] = 'xxx';
    $GLOBALS['TL_CONFIG']['ftpPort'] = 'xxx';
    ### INSTALL SCRIPT STOP ###

    I install Contao in a subdomain for testing purposes.

    The Contao Install tool screen shows:

    Modify files via FTP
    Your server does not support file access via PHP; most likely PHP runs as Apache module under a different user. Therefore please enter your FTP login details, so Contao can modify files via FTP (Safe Mode Hack).

    The install form shows pre-filled entries correct, I just reentered the password and this message shows:

    Modify files via FTP
    Could not connect to FTP server xxx
    Your server does not support file access via PHP; most likely PHP runs as Apache module under a different user. Therefore please enter your FTP login details, so Contao can modify files via FTP (Safe Mode Hack).

    Between the install attempts I removed the files in the tmp folder, that there are no leftovers.

  6. #6
    Community-Moderator xchs's Avatar
    Join Date
    06-20-09.
    Posts
    1,292

    Default Re: Manually installation

    I do not know, but it could be a problem with an incorrect ftpPath. Additionaly, you can test the functionality of the SMH with the script "smhcheck" (but right now I do not know if this script will work with SFTP too)
    Contao Community Moderator
    → Support options

  7. #7
    New user
    Join Date
    09-23-11.
    Posts
    7

    Default Re: Manually installation

    The check returns "Safe Mode is not enabled". For security reasons we don't use SFTP port 22.

    When I install other CMS products (to bypass security settings), I import all tables via phpMyAdmin manually, upload all files into the appropriate public_html folder, and write database access credentials into the config file, necessary instructions into .htaccess and index.php.

    Would this be possible with Contao, when yes, please provide instructions, since I don't know the product yet. Could be the creation of the encryption keys a problem?

  8. #8
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Manually installation

    For using SFTP I think you should try include the following in your localconfig.php:
    Code:
    $GLOBALS['TL_CONFIG']['ftpSSL'] = true;
    If that won't work then I can tell you that Contao will not work with SFTP out of the box. Because for as far as I know you would normally need the ssh2_connect and ssh2_sftp functions for an SFTP connection. Neither is in any of the Contao code...

    Perhaps we should request it as a new feature.

  9. #9
    New user
    Join Date
    09-23-11.
    Posts
    7

    Default Re: Manually installation

    Thanks for all your comments! The ”mhcheck” turned out "Safe Mode is not enabled". I followed all recommendations. I included the line code "$GLOBALS['TL_CONFIG']['ftpSSL'] = true;" in the localconfig.php file as well.

    ### INSTALL SCRIPT START ###
    $GLOBALS['TL_CONFIG']['ftpSSL'] = true;
    $GLOBALS['TL_CONFIG']['useSmhExtended'] = true;
    $GLOBALS['TL_CONFIG']['useSMHClass'] = 'SMHSFTP';
    $GLOBALS['TL_CONFIG']['ftpHost'] = 'xxx';
    $GLOBALS['TL_CONFIG']['ftpPath'] = 'public_html/demo/';
    $GLOBALS['TL_CONFIG']['ftpUser'] = 'xxx';
    $GLOBALS['TL_CONFIG']['ftpPass'] = 'xxx';
    $GLOBALS['TL_CONFIG']['ftpPort'] = 'xxx';
    ### INSTALL SCRIPT STOP ###

    This is still the error message where I am now:

    Modify files via FTP
    Could not connect to FTP server xxx
    Your server does not support file access via PHP; most likely PHP runs as Apache module under a different user. Therefore please enter your FTP login details, so Contao can modify files via FTP (Safe Mode Hack).

    I assume Contao does not allow installations on SFTP and/or with none default ports. I am open for suggestions, since I am testing the product for a client.

  10. #10
    User taca's Avatar
    Join Date
    06-20-09.
    Location
    Kyoto, Japan
    Posts
    111

    Default Re: Manually installation

    Hi.

    After quick looking into system/libraries/SMHSFTP.php (from smhextended extension), libraries/Controller.php and libraries/Files.php, your current status seems to still using Contao's FTP class not SMHSFTP class. If SMHSFTP is really enabled, the error message should be as below instead of "Could not connect to sftp":
    Code:
    Could not login to sftp: xxx
    Could not connect to sftp.
    To enable SMHSFTP class,

    • Don't set $GLOBALS['TL_CONFIG']['useFTP'] to true.[/*:m:3g4ks2wo]
    • $GLOBALS['TL_CONFIG']['ftpSSL'] woud not related to this problem.[/*:m:3g4ks2wo]

    I assume Contao does not allow installations on SFTP and/or with none default ports.
    Contao core supports FTP over SSL but not SFTP(FTP over SSH).
    The smhextended extension tried to support SFTP and the extension supports only Contao 2.8.0 (i.e. TYPOlight 2.8.0).
    So, it might not work with Contao 2.10.x (or 2.9.x).
    --
    Takahiro Kambe

  11. #11
    New user
    Join Date
    09-23-11.
    Posts
    7

    Default Re: Manually installation

    The status I am having is: I did create a database, uploaded all files, changed permissions, modified the localconfig.php:
    ### INSTALL SCRIPT START ###
    $GLOBALS['TL_CONFIG']['useSmhExtended'] = true;
    $GLOBALS['TL_CONFIG']['useSMHClass'] = 'SMHSFTP';
    $GLOBALS['TL_CONFIG']['ftpHost'] = 'xxx';
    $GLOBALS['TL_CONFIG']['ftpPath'] = 'public_html/demo/';
    $GLOBALS['TL_CONFIG']['ftpUser'] = 'xxx';
    $GLOBALS['TL_CONFIG']['ftpPass'] = 'xxx';
    $GLOBALS['TL_CONFIG']['ftpPort'] = 'xxx';
    ### INSTALL SCRIPT STOP ###

    When I run install.php (not SFTP port 22) I get this message:
    Modify files via FTP
    Could not connect to FTP server xxx
    Your server does not support file access via PHP; most likely PHP runs as Apache module under a different user. Therefore please enter your FTP login details, so Contao can modify files via FTP (Safe Mode Hack).

    The system log shows this warnings:
    [26-Sep-2011 19:47:43] PHP Warning: fgets(): supplied argument is not a valid stream resource in .../system/libraries/Config.php on line 151
    [26-Sep-2011 19:47:43] PHP Warning: feof(): supplied argument is not a valid stream resource in .../system/libraries/Config.php on line 149

  12. #12
    User taca's Avatar
    Join Date
    06-20-09.
    Location
    Kyoto, Japan
    Posts
    111

    Default Re: Manually installation

    Quote Originally Posted by eve
    The status I am having is: I did create a database, uploaded all files, changed permissions,
    How did you change permissions exactly?
    What is ther permission of these directories and a file?

    • system[/*:m:165y2c26]
    • system/config[/*:m:165y2c26]
    • system/config/localconfig.php[/*:m:165y2c26]


    Quote Originally Posted by eve
    The system log shows this warnings:
    [26-Sep-2011 19:47:43] PHP Warning: fgets(): supplied argument is not a valid stream resource in .../system/libraries/Config.php on line 151
    [26-Sep-2011 19:47:43] PHP Warning: feof(): supplied argument is not a valid stream resource in .../system/libraries/Config.php on line 149
    It looks like PHP is failed to open system/config/localconfig.php and your configuration dosen't take effect.
    This situation is before the stage using SFTP (or FTP).

    Have you check with contao-check?
    It suggests basic permissions of files and directories.
    --
    Takahiro Kambe

  13. #13
    New user
    Join Date
    09-23-11.
    Posts
    7

    Default Re: Manually installation

    I have the following permission settings:

    system 755
    system/config 775
    system/config/localconfig.php 664

    system/html 777
    system/logs 777
    system/tmp 777

    Typolight check: PHP configuration no errors

  14. #14
    User taca's Avatar
    Join Date
    06-20-09.
    Location
    Kyoto, Japan
    Posts
    111

    Default Re: Manually installation

    Hi,

    My previous analyze was almost wrong.

    I've re-read contao/install.php and it supports FTP and FTP over SSL.

    Sadly, there is no chance to intercept FTP/FTP oer SSL with FTP over SSH by smhextended extension.
    Even if smhextended extension on TYPOlight 2.8.0, it might be work as expected *after* install Contao/TYPOlight.

    So, smhextended extension could provide FTP over SSH support, but it needs some code hack to Contao core since install.php directly use ftp_connect() or ftp_ssl_connect().
    --
    Takahiro Kambe

Bookmarks

Posting Permissions

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