Results 1 to 4 of 4

Thread: Contao 4 installation

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

    Default Contao 4 installation

    Contao 4 alpha1 is available and I tried to install. A big change is that Contao 4 doesn't use .htaccess files anymore and serves the website wrom a web/ folder. Because of that my Windows 7 development web server needs a different setup. I probably did something wrong, so here's the error and what I tried, anyone have a suggestion what to do?

    http://contao4.dev/contao/install.php shows errormessages:
    Code:
    Warning: symlink(): Could not fetch file information(error 3) in C:\xampp\htdocs\contao4\system\modules\core\library\Contao\Files.php on line 300
    #0 [internal function]: __error(2, 'symlink(): Coul...', 'C:\xampp\htdocs...', 300, Array)
    #1 C:\xampp\htdocs\contao4\system\modules\core\library\Contao\Files.php(300): symlink('../../../../sys...', 'C:\xampp\htdocs...')
    #2 C:\xampp\htdocs\contao4\system\modules\core\library\Contao\Automator.php(503): Contao\Files->symlink('../../../../sys...', 'web/system/modu...')
    #3 C:\xampp\htdocs\contao4\system\modules\core\controllers\BackendInstall.php(58): Contao\Automator->generateSymlinks()
    #4 C:\xampp\htdocs\contao4\web\contao\install.php(26): Contao\BackendInstall->run()
    #5 {main}
    
    Warning: lstat(): Lstat failed for C:\xampp\htdocs\contao4/web/system/modules/calendar/assets in C:\xampp\htdocs\contao4\system\modules\core\library\Contao\Files.php on line 303
    #0 [internal function]: __error(2, 'lstat(): Lstat ...', 'C:\xampp\htdocs...', 303, Array)
    #1 C:\xampp\htdocs\contao4\system\modules\core\library\Contao\Files.php(303): lstat('C:\xampp\htdocs...')
    #2 C:\xampp\htdocs\contao4\system\modules\core\library\Contao\Automator.php(503): Contao\Files->symlink('../../../../sys...', 'web/system/modu...')
    #3 C:\xampp\htdocs\contao4\system\modules\core\controllers\BackendInstall.php(58): Contao\Automator->generateSymlinks()
    #4 C:\xampp\htdocs\contao4\web\contao\install.php(26): Contao\BackendInstall->run()
    #5 {main}
    Part of Apache 2.4 httpd-chosts.conf
    Code:
    <VirtualHost *:80>
        DocumentRoot C:/xampp/htdocs/contao4/web
        ServerName contao4.dev
        <Directory "C:/xampp/htdocs/contao4">
       	AllowOverride All
       	Options Indexes FollowSymLinks
       	Order allow,deny
       	Allow from all
        </Directory>
    </VirtualHost>
    I'm running PHP 5.4.7

  2. #2
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default

    Hmm, according to this SO question the mentioned issue _should_ actually be solved with the release of PHP 5.4.7. Does it work if you manually create the few symlinks (for the "themes", "assets" folder etc.) with the "mklink" (or the 3rd party "junction") command? This is of course not a real solution to the problem, though.
    Contao Community Moderator
    → Support options

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

    Default

    I ran a linux live disk and installed apache and set everything up. Then the installation works and symlinks are created. Unfortunately I did not install 5.4.7 but 5.5.something.

    Quote Originally Posted by xchs View Post
    Hmm, according to this SO question the mentioned issue _should_ actually be solved with the release of PHP 5.4.7.
    Yep, found that as well. So it is probably something Windows related...

    Quote Originally Posted by xchs View Post
    Does it work if you manually create the few symlinks (for the "themes", "assets" folder etc.) with the "mklink" (or the 3rd party "junction") command? This is of course not a real solution to the problem, though.
    Will try that asap.
    Last edited by Ruud; 06/12/2014 at 21:48.

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

    Default

    I found that indeed the symlink function is the problem. I replaced it with the code below and my installation works now!

    \system\modules\core\library\Contao\Files.php@line 299
    PHP Code:
    // Create the symlink
    // symlink($strSource, TL_ROOT . '/' . $strTarget);

    // Flag as directory
    $pSwitch '';
    if (!
    is_dir($strSource)) { // Edited this line, now seems illogical...
        
    $pSwitch '/d';
    }

    // Change / to \ because it will break otherwise.
    // ps, Contao variable names don't match PHP convention. Very confusing.
    $target str_replace('/''\\'$strSource);
    $link str_replace('/''\\'TL_ROOT '/' $strTarget);
    return 
    exec('mklink ' $pSwitch ' "' $link '" "' $target '"'); 
    I also had to disable a few lines higher, unlinking symlinks. the function is_link did not return the expected result. I did not look for an alternative.

    [EDIT]
    It shows that I have no idea how this works exactly; the code I wrote above does not work without problem!
    I edited the code so it does work, but part of the $target is removed when creating links. So after this ran, I copy missing files back into the original location (So this is just for short test purposes). I was missing files in some of the assets folders in /system/modules. I have no idea why only the assets folders were missing files...
    [/EDIT]
    Last edited by Ruud; 06/16/2014 at 14:07. Reason: Extra important information!!

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
  •