contao / core

Contao 3 → see contao/contao for Contao 4
GNU Lesser General Public License v3.0
492 stars 213 forks source link

Contao4: Neuer Website Startpunkt erstellen > Warning: scandir ... failed to open dir #7200

Closed pressi closed 9 years ago

pressi commented 10 years ago

Hallo!

Ich habe gerade Contao 4 installiert. Beim erstellen des Seitenbaumes bin ich auf einen Fehler gestoßen.

Beim anlegen des Website Startpunktes bekomme ich beim Speichern folgenden Fehler:

Warning: scandir(/Users/stephan/Documents/Produktion/Websites/Intern/Contao4/share/): failed to open dir: No such file or directory in system/helper/functions.php on line 194
#0 [internal function]: __error(2, 'scandir(/Users/...', '/Users/stephan/...', 194, Array)
#1 system/helper/functions.php(194): scandir('/Users/stephan/...')
#2 vendor/contao/contao-library/src/Automator.php(314): scan('/Users/stephan/...')
#3 vendor/contao/contao-library/src/Automator.php(344): Contao\Automator->purgeXmlFiles()
#4 system/modules/core/dca/tl_page.php(1546): Contao\Automator->generateSitemap('1')
#5 vendor/contao/module-core/src/drivers/DC_Table.php(1975): tl_page->updateSitemap(Object(Contao\DC_Table))
#6 vendor/contao/contao-library/src/Backend.php(576): Contao\DC_Table->edit()
#7 vendor/contao/module-core/src/controllers/BackendMain.php(131): Contao\Backend->getBackendModule('page')
#8 web/contao/main.php(24): Contao\BackendMain->run()
#9 {main}

Warning: scandir(): (errno 2): No such file or directory in system/helper/functions.php on line 194
#0 [internal function]: __error(2, 'scandir(): (err...', '/Users/stephan/...', 194, Array)
#1 system/helper/functions.php(194): scandir('/Users/stephan/...')
#2 vendor/contao/contao-library/src/Automator.php(314): scan('/Users/stephan/...')
#3 vendor/contao/contao-library/src/Automator.php(344): Contao\Automator->purgeXmlFiles()
#4 system/modules/core/dca/tl_page.php(1546): Contao\Automator->generateSitemap('1')
#5 vendor/contao/module-core/src/drivers/DC_Table.php(1975): tl_page->updateSitemap(Object(Contao\DC_Table))
#6 vendor/contao/contao-library/src/Backend.php(576): Contao\DC_Table->edit()
#7 vendor/contao/module-core/src/controllers/BackendMain.php(131): Contao\Backend->getBackendModule('page')
#8 web/contao/main.php(24): Contao\BackendMain->run()
#9 {main}

Warning: Invalid argument supplied for foreach() in system/helper/functions.php on line 194
#0 system/helper/functions.php(194): __error(2, 'Invalid argumen...', '/Users/stephan/...', 194, Array)
#1 vendor/contao/contao-library/src/Automator.php(314): scan('/Users/stephan/...')
#2 vendor/contao/contao-library/src/Automator.php(344): Contao\Automator->purgeXmlFiles()
#3 system/modules/core/dca/tl_page.php(1546): Contao\Automator->generateSitemap('1')
#4 vendor/contao/module-core/src/drivers/DC_Table.php(1975): tl_page->updateSitemap(Object(Contao\DC_Table))
#5 vendor/contao/contao-library/src/Backend.php(576): Contao\DC_Table->edit()
#6 vendor/contao/module-core/src/controllers/BackendMain.php(131): Contao\Backend->getBackendModule('page')
#7 web/contao/main.php(24): Contao\BackendMain->run()
#8 {main}

Warning: Cannot modify header information - headers already sent by (output started at /Users/stephan/Documents/Produktion/Websites/Intern/Contao4/system/helper/functions.php:70) in vendor/contao/contao-library/src/System.php on line 527
#0 [internal function]: __error(2, 'Cannot modify h...', '/Users/stephan/...', 527, Array)
#1 vendor/contao/contao-library/src/System.php(527): setcookie('BE_PAGE_OFFSET', '0', 0, '/', '', false, false)
#2 vendor/contao/module-core/src/drivers/DC_Table.php(2025): Contao\System::setCookie('BE_PAGE_OFFSET', 0, 0)
#3 vendor/contao/contao-library/src/Backend.php(576): Contao\DC_Table->edit()
#4 vendor/contao/module-core/src/controllers/BackendMain.php(131): Contao\Backend->getBackendModule('page')
#5 web/contao/main.php(24): Contao\BackendMain->run()
#6 {main}

Der Fehler liegt daran das TL_ROOT nicht "web" beinhaltet bzw. gehört das beim Automator eingefügt.

Datei: vendor/contao/contao-library/src/Automator.php Funktion: purgeXmlFiles (Zeile: #288)

Zeile: #311

// Delete the old files
        if (!$blnReturn)
        {
            foreach (scan(TL_ROOT . '/share') as $file)
            {
                if (is_dir(TL_ROOT . '/share/' . $file))
                {
                    continue; // see #6652
                }

                $objFile = new File('share/' . $file);

                if ($objFile->extension == 'xml' && !in_array($objFile->filename, $arrFeeds))
                {
                    $objFile->delete();
                }
            }
        }

Ich denke das hier der Pfad angepasst gehört oder hab ich bei den Einstellungen was falsch gemacht?

BugBuster1701 commented 10 years ago

Deine Domain muss in das web Verzeichnis zeigen. Das ist die neue Trennung zwischen öffentlich zugängliche Dateien und nicht solchen.

BugBuster1701 commented 10 years ago

Und das Ticket für Contao 4 bitte hier her das nächste Mal. https://github.com/contao/contao/issues

pressi commented 10 years ago

@BugBuster1701 Dass das Ticket am falschen Platz ist hab ich leider zu spät bemerkt. Und mein Root-Verzeichnis ist das "web" Verzeichnis.

BugBuster1701 commented 10 years ago

Wenn das so wäre, dann hättest du das Problem nicht. Denn web/share gibt es ja, und damit TL_ROOT/share. Sprich http://domain.de/share/robots.txt müsstest du aufrufen können.

leofeyer commented 10 years ago

@BugBuster1701 Es handelt sich hierbei um einen Bug. Das System muss so angepasst werden, dass alle Ressourcen direkt im web/-Ordner erstellt werden.

BugBuster1701 commented 10 years ago

achja, TL_ROOT ist ja ein Verzeichnis "höher". Stimmt.

leofeyer commented 9 years ago

Dieses Problem ist mittlerweile behoben worden.