2013-04-19 5 views
5

Nach dem Hinzufügen des Session-Helfers zum App-Controller beginnt Apache zu stürzen. Ich habe das Problem mit der Protokollierung verfolgt und festgestellt, dass in/CORE/cake/libs/controller/component/session die Funktion check() einmal ausgeführt wird und nicht beendet wird. Die aufgerufene Funktion __start() läuft jedoch unendlich (zumindest bis Apache abstürzt). Und indem ich unendlich laufe, meine ich, dass die gesamte Funktion mehrfach durchlaufen wird. Auch dies passiert, wenn ich den Sitzungshelfer im App-Controller hinzufüge. Ohne es scheint Cake gut zu laufen, bis ich einen Punkt traf, wo der Sitzungshelfer in einer Ansicht verwendet wird. Dieses System wird von Cake 1.1 aktualisiert und in Cake 1.1 wurde der Session-Helfer automatisch eingebunden und lief gut. Ich habe dies sowohl auf Kuchen 1.3.7 und Kuchen 1.3.15 mit dem gleichen Ergebnis versucht. Ich vermute etwas mit den Session-Einstellungen Konflikte mit der Art, wie Cake 1.3 Dinge tut. Im Folgenden finden Sie meine Konfigurationsdatei, die Absturzinformationen von Apache und das Apache-Protokoll kurz vor dem Absturz. Wenn andere Informationen hilfreich sein könnten, lassen Sie es mich bitte in den Kommentaren wissen. Irgendwelche Vorschläge, wie man das beheben kann? Vielen Dank!CakePHP 1.3 - Unendliche Looping in Kuchen Bibliotheken, Apache Absturz, Session Helfer und __start()?

EDIT: Ich habe vergessen, eine relevante discussion here zu integrieren. Leider haben sie hier keine klare Lösung, aber sie scheinen den Fehler in Kuchen beheben zu wollen, wo ich meinen Code gerne ändern würde, um den Fehler zu vermeiden.

EDIT 2: Ich habe kürzlich entdeckt, dass der Manager dieses Projekts plant, die Verwendung von Datenbanksitzungen in der Zukunft einzustellen, so dass die Situation für mich vollständig behoben wird. Natürlich werde ich diese Frage den zukünftigen Besuchern überlassen.

app/config/core.php:

<?php 
/** 
* This is core configuration file. 
* 
* Use it to configure core behavior of Cake. 
* 
* PHP versions 4 and 5 
* 
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) 
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) 
* 
* Licensed under The MIT License 
* Redistributions of files must retain the above copyright notice. 
* 
* @copyright  Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) 
* @link   http://cakephp.org CakePHP(tm) Project 
* @package  cake 
* @subpackage cake.app.config 
* @since   CakePHP(tm) v 0.2.9 
* @license  MIT License (http://www.opensource.org/licenses/mit-license.php) 
*/ 

/** 
* CakePHP Debug Level: 
* 
* Production Mode: 
* 0: No error messages, errors, or warnings shown. Flash messages redirect. 
* 
* Development Mode: 
* 1: Errors and warnings shown, model caches refreshed, flash messages halted. 
* 2: As in 1, but also with full debug messages and SQL output. 
* 
* In production mode, flash messages redirect after a time interval. 
* In development mode, you need to click the flash message to continue. 
*/ 
    //Configure::write('debug', 2); 

/** 
* CakePHP Log Level: 
* 
* In case of Production Mode CakePHP gives you the possibility to continue logging errors. 
* 
* The following parameters can be used: 
* Boolean: Set true/false to activate/deactivate logging 
* Configure::write('log', true); 
* 
* Integer: Use built-in PHP constants to set the error level (see error_reporting) 
* Configure::write('log', E_ERROR | E_WARNING); 
* Configure::write('log', E_ALL^E_NOTICE); 
*/ 
    //Configure::write('log', true); 

/** 
* Application wide charset encoding 
*/ 
    //Configure::write('App.encoding', 'UTF-8'); 

/** 
* To configure CakePHP *not* to use mod_rewrite and to 
* use CakePHP pretty URLs, remove these .htaccess 
* files: 
* 
* /.htaccess 
* /app/.htaccess 
* /app/webroot/.htaccess 
* 
* And uncomment the App.baseUrl below: 
*/ 
    //Configure::write('App.baseUrl', env('SCRIPT_NAME')); 

/** 
* Uncomment the define below to use CakePHP prefix routes. 
* 
* The value of the define determines the names of the routes 
* and their associated controller actions: 
* 
* Set to an array of prefixes you want to use in your application. Use for 
* admin or other prefixed routes. 
* 
* Routing.prefixes = array('admin', 'manager'); 
* 
* Enables: 
* `admin_index()` and `/admin/controller/index` 
* `manager_index()` and `/manager/controller/index` 
* 
* [Note Routing.admin is deprecated in 1.3. Use Routing.prefixes instead] 
*/ 
    //Configure::write('Routing.prefixes', array('admin')); 

/** 
* Turn off all caching application-wide. 
* 
*/ 
    //Configure::write('Cache.disable', true); 

    define('DEBUG', 2); 
    define('DEBUG_AJAX', true); 
/** 
* Enable cache checking. 
* 
* If set to true, for view caching you must still use the controller 
* var $cacheAction inside your controllers to define caching settings. 
* You can either set it controller-wide by setting var $cacheAction = true, 
* or in each action using $this->cacheAction = true. 
* 
*/ 
    Configure::write('Cache.check', false); 

/** 
* Defines the default error type when using the log() function. Used for 
* differentiating error logging and debugging. Currently PHP supports LOG_DEBUG. 
*/ 
    define('LOG_ERROR', 2); 

/** 
* The preferred session handling method. Valid values: 
* 
* 'php'   Uses settings defined in your php.ini. 
* 'cake'  Saves session files in CakePHP's /tmp directory. 
* 'database' Uses CakePHP's database sessions. 
* 
* To define a custom session handler, save it at /app/config/<name>.php. 
* Set the value of 'Session.save' to <name> to utilize it in CakePHP. 
* 
* To use database sessions, run the app/config/schema/sessions.php schema using 
* the cake shell command: cake schema create Sessions 
* 
*/ 
    Configure::write('Session.save', 'database'); 

/** 
* The model name to be used for the session model. 
* 
* 'Session.save' must be set to 'database' in order to utilize this constant. 
* 
* The model name set here should *not* be used elsewhere in your application. 
*/ 
    Configure::write('Session.model', 'Session'); 

/** 
* The name of the table used to store CakePHP database sessions. 
* 
* 'Session.save' must be set to 'database' in order to utilize this constant. 
* 
* The table name set here should *not* include any table prefix defined elsewhere. 
* 
* Please note that if you set a value for Session.model (above), any value set for 
* Session.table will be ignored. 
* 
* [Note: Session.table is deprecated as of CakePHP 1.3] 
*/ 
    Configure::write('Session.table', 'cake_sessions'); 

/** 
* The DATABASE_CONFIG::$var to use for database session handling. 
* 
* 'Session.save' must be set to 'database' in order to utilize this constant. 
*/ 
    Configure::write('Session.database', 'default'); 

/** 
* The name of CakePHP's session cookie. 
* 
* Note the guidelines for Session names states: "The session name references 
* the session id in cookies and URLs. It should contain only alphanumeric 
* characters." 
* @link http://php.net/session_name 
*/ 
    Configure::write('Session.cookie', 'CAKEPHP'); 

/** 
* Session time out time (in seconds). 
* Actual value depends on 'Security.level' setting. 
*/ 
    Configure::write('Session.timeout', '120'); 

/** 
* If set to false, sessions are not automatically started. 
*/ 
    Configure::write('Session.start', true); 

/** 
* When set to false, HTTP_USER_AGENT will not be checked 
* in the session. You might want to set the value to false, when dealing with 
* older versions of IE, Chrome Frame or certain web-browsing devices and AJAX 
*/ 
    Configure::write('Session.checkAgent', true); 

/** 
* The level of CakePHP security. The session timeout time defined 
* in 'Session.timeout' is multiplied according to the settings here. 
* Valid values: 
* 
* 'high' Session timeout in 'Session.timeout' x 10 
* 'medium' Session timeout in 'Session.timeout' x 100 
* 'low' Session timeout in 'Session.timeout' x 300 
* 
* CakePHP session IDs are also regenerated between requests if 
* 'Security.level' is set to 'high'. 
*/ 
    Configure::write('Security.level', 'low'); 

/** 
* A random string used in security hashing methods. 
*/ 
    Configure::write('Security.salt', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi'); 

/** 
* A random numeric string (digits only) used to encrypt/decrypt strings. 
*/ 
    Configure::write('Security.cipherSeed', '76859309657453542496749683645'); 

/** 
* Apply timestamps with the last modified time to static assets (js, css, images). 
* Will append a querystring parameter containing the time the file was modified. This is 
* useful for invalidating browser caches. 
* 
* Set to `true` to apply timestamps, when debug = 0, or set to 'force' to always enable 
* timestamping. 
*/ 
    //Configure::write('Asset.timestamp', true); 
/** 
* Compress CSS output by removing comments, whitespace, repeating tags, etc. 
* This requires a/var/cache directory to be writable by the web server for caching. 
* and /vendors/csspp/csspp.php 
* 
* To use, prefix the CSS link URL with '/ccss/' instead of '/css/' or use HtmlHelper::css(). 
*/ 
    //Configure::write('Asset.filter.css', 'css.php'); 

/** 
* Plug in your own custom JavaScript compressor by dropping a script in your webroot to handle the 
* output, and setting the config below to the name of the script. 
* 
* To use, prefix your JavaScript link URLs with '/cjs/' instead of '/js/' or use JavaScriptHelper::link(). 
*/ 
    //Configure::write('Asset.filter.js', 'custom_javascript_output_filter.php'); 

/** 
* The classname and database used in CakePHP's 
* access control lists. 
*/ 
    Configure::write('Acl.classname', 'DbAcl'); 
    Configure::write('Acl.database', 'default'); 

/** 
* If you are on PHP 5.3 uncomment this line and correct your server timezone 
* to fix the date & time related errors. 
*/ 
    //date_default_timezone_set('UTC'); 

/** 
* 
* Cache Engine Configuration 
* Default settings provided below 
* 
* File storage engine. 
* 
* Cache::config('default', array(
*  'engine' => 'File', //[required] 
*  'duration'=> 3600, //[optional] 
*  'probability'=> 100, //[optional] 
*  'path' => CACHE, //[optional] use system tmp directory - remember to use absolute path 
*  'prefix' => 'cake_', //[optional] prefix every cache file with this string 
*  'lock' => false, //[optional] use file locking 
*  'serialize' => true, [optional] 
* )); 
* 
* 
* APC (http://pecl.php.net/package/APC) 
* 
* Cache::config('default', array(
*  'engine' => 'Apc', //[required] 
*  'duration'=> 3600, //[optional] 
*  'probability'=> 100, //[optional] 
*  'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string 
* )); 
* 
* Xcache (http://xcache.lighttpd.net/) 
* 
* Cache::config('default', array(
*  'engine' => 'Xcache', //[required] 
*  'duration'=> 3600, //[optional] 
*  'probability'=> 100, //[optional] 
*  'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string 
*  'user' => 'user', //user from xcache.admin.user settings 
*  'password' => 'password', //plaintext password (xcache.admin.pass) 
* )); 
* 
* 
* Memcache (http://www.danga.com/memcached/) 
* 
* Cache::config('default', array(
*  'engine' => 'Memcache', //[required] 
*  'duration'=> 3600, //[optional] 
*  'probability'=> 100, //[optional] 
*  'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string 
*  'servers' => array(
*   '127.0.0.1:11211' // localhost, default port 11211 
*  ), //[optional] 
*  'compress' => false, // [optional] compress data in Memcache (slower, but uses less memory) 
* )); 
* 
*/ 
    Cache::config('default', array('engine' => 'File')); 

/** 
* This is the URL at which your working copy 
* is accessed -- no trailing forward slash 
*/ 
     define('BIRT_REPORT_BASE_URL', ''); 

/** 
* This is the directory to which BIRT has 
* permission to write files during graphing 
*/ 
     define('BIRT_REPORT_WRITABLE_IMAGE_DIR', ''); 

Apache Absturz:

Problem signature: 
    Problem Event Name: APPCRASH 
    Application Name: httpd.exe 
    Application Version: 2.2.11.0 
    Application Timestamp: 493f5d44 
    Fault Module Name: php5ts.dll 
    Fault Module Version: 5.2.9.9 
    Fault Module Timestamp: 49a56925 
    Exception Code: c00000fd 
    Exception Offset: 001a049d 
    OS Version: 6.1.7601.2.1.0.768.3 
    Locale ID: 1033 
    Additional Information 1: 8278 
    Additional Information 2: 82782538381a8681201b9137311ac754 
    Additional Information 3: 9f8d 
    Additional Information 4: 9f8d09670f894d997bbbca5236befa87 

Apache error.log:

[Fri Apr 19 10:52:01 2013] [notice] Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9 configured -- resuming normal operations 
[Fri Apr 19 10:52:01 2013] [notice] Server built: Dec 10 2008 00:10:06 
[Fri Apr 19 10:52:01 2013] [notice] Parent: Created child process 7024 
[Fri Apr 19 10:52:02 2013] [notice] Digest: generating secret for digest authentication ... 
[Fri Apr 19 10:52:02 2013] [notice] Digest: done 
[Fri Apr 19 10:52:03 2013] [notice] Child 7024: Child process is running 
[Fri Apr 19 10:52:03 2013] [notice] Child 7024: Acquired the start mutex. 
[Fri Apr 19 10:52:03 2013] [notice] Child 7024: Starting 250 worker threads. 
[Fri Apr 19 10:52:03 2013] [notice] Child 7024: Starting thread to listen on port 443. 
[Fri Apr 19 10:52:03 2013] [notice] Child 7024: Starting thread to listen on port 80. 
+0

Ich habe für die Mühe upvoted. Ist es möglich, auf Kuchen 2.x zu aktualisieren? –

+1

Wir hoffen darauf irgendwann. Aber wir würden gerne zuerst zu Kuchen 1.3 kommen, so dass wir die gut dokumentierten Übergangsmethoden von 1.3 bis 2.x verwenden können. Es ist eigentlich ein ziemlich großes (und altes System), so dass der Übergang eine Weile dauern kann und wenn wir schnell zu 1.3 kommen, würde es mit vielen Problemen helfen, die wir jetzt haben, weil es uns erlaubt, eine neuere Version von PHP schnell zu verwenden. Ein Upgrade auf 2.x ist also eine gute Wahl, aber wir möchten, wenn möglich, die schnellere Version 1.3. –

+0

Können Sie versuchen, die Sitzungen zu ändern, um die Datenbank nicht zu verwenden? http://book.cakephp.org/1.3/en/The-Manual/Core-Components/Sessions.html – systematical

Antwort

0

Ich habe eine Abhilfe gefunden, dass das erlaubt Datenbankversion der Sitzungen zu arbeiten. Es ist keine Lösung, aber es wird wahrscheinlich für meine Situation funktionieren, obwohl die wirkliche Lösung immer noch bevorzugt werden würde.

Die Arbeit um ist den Agenten-Check auszuschalten:

Configure::write('Session.checkAgent', false); 
+0

Können Sie das Schema Ihrer Sitzungstabelle freigeben? Hat es eine Spalte zum Speichern des Benutzeragenten? –

+1

@AdamBrett: Nein, die einzigen Spalten in der Tabelle cake_sessions sind ID (VARCHAR), Daten (TEXT) und läuft ab (INT) –