Results 1 to 8 of 8

Thread: Website broken – localconfig.php corrupt

  1. #1
    User
    Join Date
    08-15-09.
    Location
    Sweden
    Posts
    82

    Default Website broken – localconfig.php corrupt

    Hi,
    I client contacted me the other day. Their website had stopped working. The only thing that worked was the error message that showed up.

    After some investigation I found out that the file localconfig.php was almost empty. No settings. (Just some of the first commented lines in the file showed up.) But why did this happen?

    After further investigation I found out that that the clients storage was full on their web hosting provider. No more files where able to be saved on the server.

    So to fix this, I told the client to remove old mails from their inbox to free up space on the server. Next, I told the hosting provider to recreate the localconfig.php file from a backup. After one day the site was up and running again.

    I understand that the localconfig.php file was reset due to the storage was full. No more files could be saved/resaved. But it gives me more questions:

    1. Is the localconfig.php file resaved occasionally by Contao under normal use? (No backend administration was made when the file was reset.)
    2. Do you think there should be a check before the localconfig.php file gets edited, to see if the file system allows editing?

  2. #2
    User
    Join Date
    10-15-10.
    Posts
    279

    Default Re: Website broken – localconfig.php corrupt

    That sounds a bit strange as you would think if the file were to be re-saved that it would overwrite and not delete+save. For a file to be emptied in such a manner that would have to be the case, or someone edited the file and removed all of its contents on purpose.

    If delete+save were a viable thought, then during the < 3 seconds that it takes for a command to delete and write the config file that something filled that disk space with other data, ignoring the current process? It just seems unlikely.


    And that is a good question to bring up:

    Does the localconfig.php file have to be automatically edited by the system at any given point in time? If not, then lock it down to read-only by the system.

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

    Default Re: Website broken – localconfig.php corrupt

    Quote Originally Posted by Ola
    1. Is the localconfig.php file resaved occasionally by Contao under normal use? (No backend administration was made when the file was reset.)
    This configuration file gets updated everytime when the daily/weekly cron job is triggered (the timestamps will be saved). Additionally, Contao checks for the latest version available and write the version number to the "localconfig.php".
    Contao Community Moderator
    → Support options

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

    Default Re: Website broken – localconfig.php corrupt

    Quote Originally Posted by xchs
    This configuration file gets updated everytime when the daily/weekly cron job is triggered (the timestamps will be saved). Additionally, Contao checks for the latest version available and write the version number to the "localconfig.php".
    And currently, system/libraries/Config.php seems to do:

    1. Simply open "localconfig.php",[/*0ejj2oy]
    2. write the data,[/*0ejj2oy]
    3. close the file.[/*:m0ejj2oy]

    Traditonall Unix program would be create temporary file and rename it after write succefully.
    But such creating a file and remaing might be restricted by PHP's environment...
    --
    Takahiro Kambe

  5. #5
    User
    Join Date
    08-15-09.
    Location
    Sweden
    Posts
    82

    Default Re: Website broken – localconfig.php corrupt

    Weird. Today I just realized that one of my other sites had just stopped working. I don't know for how long the site has been down, because I don't visit it that often. But, just like before, the localconfig.php file seems to be the problem. This is what's left in the file:
    Code:
    ### INSTALL SCRIPT START ###
    $GLOBALS['TL_CONFIG']['websitePath'] = '';
    ### INSTALL SCRIPT STOP ###
    
    ?>
    This time, there was plenty of available disc space on the web host. So I have no clue what's going on.

    Maybe this might be a problem at the webhost? But still, there should be some sort of safety error checking to prevent such a critical file to just be corrupted.

  6. #6
    User
    Join Date
    08-15-09.
    Location
    Sweden
    Posts
    82

    Default Re: Website broken – localconfig.php corrupt

    After some investigation (German is not my main language) I finally found out that this is a known problem, that has been fixed and will be implemented i version 2.10.

    http://dev.contao.org/issues/2616

  7. #7
    New user
    Join Date
    09-13-12.
    Posts
    1

    Default Re: Website broken – v2.11 - empty (leeres) localconfig.php

    I recently had 2 separate incidents with websites where "empty localconfig.php files" caused the site to stop working:
    - one in Holland -- Typolight version 2.8
    - one in Canada -- Contao version 2.11

    In both cases I found an "almost-empty" localconfig file. Example :

    Code:
     <?php
    
    ### INSTALL SCRIPT START ###
    $GLOBALS['TL_CONFIG']['websitePath'] = '/debranche.html';
    ### INSTALL SCRIPT STOP ###
    
    ?>
    More interesting this seems to be a known problem, that was supposed to have been solved in version 2.10.
    Leo Feyer closed the issue 10 months ago, read https://github.com/contao/core/issues/2616 :
    "Die Kombination aus diesen Maßnahmen sollte alle Aspekte des Problems beheben."

    I can vouch for the fact that the problem exists beyond version 2.10 of Contao.
    Can it be that the actual code never got promoted to the 2.10 or 2.11 update?
    Thanks for your attention, herzlichen dank für die Mühe

    Arnold B.

  8. #8
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    499

    Default Re: Website broken – localconfig.php corrupt

    Seams to be implemented if you're using the new fe_page template with the new cron.

    https://github.com/contao/core/commit/6 ... 94f0f7151e
    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

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
  •