Jump to content
Larry Ullman's Book Forums

Recommended Posts

Hello!

 

Where is my mistake? This is admin area

 

session_regenerate_id(): Cannot regenerate session id - headers already sent

Array(    [0] => Array        (            [function] => my_error_handler            [args] => Array                (                    [0] => 2                    [1] => session_regenerate_id(): Cannot regenerate session id - headers already sent                    [2] => /hsphere/local/home/webdeveloperrr/naiti.info/includes/login.inc.php                    [3] => 43                    [4] => Array                        (                            [_GET] => Array                                (                                )                            [_POST] => Array                                (                                    [email] => webdeveloperrr@gmail.com                                    [pass] => 12345                                )                            [_COOKIE] => Array                                (                                    [SESSION] => 27183f1960ae23365a240b30ed5599d5                                    [wp-settings-time-1] => 1522262771                                )                            [_FILES] => Array                                (                                )                            [_SERVER] => Array                                (                                    [PHPRC] => ./                                    [PHP_FCGI_CHILDREN] => 0                                    [PATH] => /hsphere/shared/apache2/bin:/sbin:/usr/sbin:/bin:/usr/bin                                    [PWD] => /hsphere/local/config/php/webdeveloperrr/naiti.info                                    [PHP_DOCROOT] => /hsphere/local/home/webdeveloperrr/naiti.info                                    [SHLVL] => 0                                    [PHP_FCGI_MAX_REQUESTS] => 5000                                    [ORIG_SCRIPT_NAME] => /fcgi-bin/php-fcgi                                    [ORIG_PATH_TRANSLATED] => /hsphere/local/home/webdeveloperrr/naiti.info/index.php                                    [ORIG_PATH_INFO] => /index.php                                    [ORIG_SCRIPT_FILENAME] => /hsphere/local/config/php/webdeveloperrr/naiti.info/php-fcgi                                    [SCRIPT_NAME] => /index.php                                    [REQUEST_URI] => /index.php                                    [QUERY_STRING] =>                                     [REQUEST_METHOD] => POST                                    [SERVER_PROTOCOL] => HTTP/1.0                                    [GATEWAY_INTERFACE] => CGI/1.1                                    [REDIRECT_URL] => /index.php                                    [REMOTE_PORT] => 56566                                    [SCRIPT_FILENAME] => /hsphere/local/home/webdeveloperrr/naiti.info/index.php                                    [SERVER_ADMIN] => webmaster@naiti.info                                    [DOCUMENT_ROOT] => /hsphere/local/home/webdeveloperrr/naiti.info                                    [REMOTE_ADDR] => 143.1222222                                    [SERVER_PORT] => 80                                    [SERVER_ADDR] => 127.0.0.1                                    [SERVER_NAME] => naiti.info                                    [SERVER_SOFTWARE] => Apache                                    [SERVER_SIGNATURE] =>                                     [HTTP_COOKIE] => SESSION=27183f1960ae23365a240b30ed5599d5; wp-settings-time-1=1522262771                                    [HTTP_ACCEPT_LANGUAGE] => ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7                                    [HTTP_ACCEPT_ENCODING] => gzip, deflate                                    [HTTP_REFERER] => http://naiti.info/index.php                                    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8                                    [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36                                    [CONTENT_TYPE] => application/x-www-form-urlencoded                                    [HTTP_UPGRADE_INSECURE_REQUESTS] => 1                                    [HTTP_ORIGIN] => http://naiti.info                                    [HTTP_CACHE_CONTROL] => max-age=0                                    [CONTENT_LENGTH] => 46                                    [HTTP_CONNECTION] => close                                    [HTTP_X_FORWARDED_PROTO] => http                                    [HTTP_X_FORWARDED_FOR] => 143.12222222                                    [HTTP_X_REAL_IP] => 143.1222222                                    [HTTP_HOST] => naiti.info                                    [REDIRECT_STATUS] => 200                                    [REDIRECT_HANDLER] => application/x-httpd-fcgiphp-56                                    [FCGI_ROLE] => RESPONDER                                    [PHP_SELF] => /index.php                                    [REQUEST_TIME_FLOAT] => 1523349966.2761                                    [REQUEST_TIME] => 1523349966                                )                            [_REQUEST] => Array                                (                                    [email] => webdeveloperrr@gmail.com                                    [pass] => 12345                                )                            [_ENV] => Array                                (                                )                            [GLOBALS] => Array *RECURSION*                            [_SESSION] => Array                                (                                )                            [dbc] => mysqli Object                                (                                    [affected_rows] => 1                                    [client_info] => mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $                                    [client_version] => 50011                                    [connect_errno] => 0                                    [connect_error] =>                                     [errno] => 0                                    [error] =>                                     [error_list] => Array                                        (                                        )                                    [field_count] => 5                                    [host_info] => mysql20.host11111 via TCP/IP                                    [info] =>                                     [insert_id] => 0                                    [server_info] => 5.6.15-56-log                                    [server_version] => 50615                                    [stat] => Uptime: 3112141  Threads: 2  Questions: 388594528  Slow queries: 1355  Opens: 2817600  Flush tables: 1  Open tables: 14000  Queries per second avg: 124.864                                    [sqlstate] => 00000                                    [protocol_version] => 10                                    [thread_id] => 3743443                                    [warning_count] => 0                                )                            [login_errors] => Array                                (                                )                            [e] => webdeveloperrr@gmail.com                            [p] => 12345                            [q] => SELECT id, username, type, pass, IF(date_expires >= NOW(), true, false) AS expired FROM users WHERE email='webdeveloperrr@gmail.com'                            [r] => mysqli_result Object                                (                                    [current_field] => 0                                    [field_count] => 5                                    [lengths] => Array                                        (                                            [0] => 1                                            [1] => 5                                            [2] => 5                                            [3] => 60                                            [4] => 1                                        )                                    [num_rows] => 1                                    [type] => 0                                )                            [row] => Array                                (                                    [id] => 1                                    [username] => admin                                    [type] => admin                                    [pass] => 1111110$zPw7R/5PBYshXUdnsDCfRuTdrJ0lAfowseUIB1Fl3kvFEw21t0MqC                                    [expired] => 0                                )                        )                )        )    [1] => Array        (            [file] => /hsphere/local/home/webdeveloperrr/naiti.info/includes/login.inc.php            [line] => 43            [function] => session_regenerate_id            [args] => Array                (                    [0] => 1                )        )    [2] => Array        (            [file] => /hsphere/local/home/webdeveloperrr/naiti.info/index.php            [line] => 22            [args] => Array                (                    [0] => /hsphere/local/home/webdeveloperrr/naiti.info/includes/login.inc.php                )            [function] => include        ))
(    [0] => Array        (            [function] => my_error_handler            [args] => Array                (                    [0] => 2                    [1] => session_regenerate_id(): Cannot regenerate session id - headers already sent                    [2] => /hsphere/local/home/webdeveloperrr/naiti.info/includes/login.inc.php                    [3] => 43                    [4] => Array                        (                            [_GET] => Array                                (                                )                            [_POST] => Array                                (                                    [email] => webdeveloperrr@gmail.com                                    [pass] => Poutrou1                                )                            [_COOKIE] => Array                                (                                    [SESSION] => 27183f1960ae23365a240b30ed5599d5                                    [wp-settings-time-1] => 1522262771                                )                            [_FILES] => Array                                (                                )                            [_SERVER] => Array                                (                                    [PHPRC] => ./                                    [PHP_FCGI_CHILDREN] => 0                                    [PATH] => /hsphere/shared/apache2/bin:/sbin:/usr/sbin:/bin:/usr/bin                                    [PWD] => /hsphere/local/config/php/webdeveloperrr/naiti.info                                    [PHP_DOCROOT] => /hsphere/local/home/webdeveloperrr/naiti.info                                    [SHLVL] => 0                                    [PHP_FCGI_MAX_REQUESTS] => 5000                                    [ORIG_SCRIPT_NAME] => /fcgi-bin/php-fcgi                                    [ORIG_PATH_TRANSLATED] => /hsphere/local/home/webdeveloperrr/naiti.info/index.php                                    [ORIG_PATH_INFO] => /index.php                                    [ORIG_SCRIPT_FILENAME] => /hsphere/local/config/php/webdeveloperrr/naiti.info/php-fcgi                                    [SCRIPT_NAME] => /index.php                                    [REQUEST_URI] => /index.php                                    [QUERY_STRING] =>                                     [REQUEST_METHOD] => POST                                    [SERVER_PROTOCOL] => HTTP/1.0                                    [GATEWAY_INTERFACE] => CGI/1.1                                    [REDIRECT_URL] => /index.php                                    [REMOTE_PORT] => 56566                                    [SCRIPT_FILENAME] => /hsphere/local/home/webdeveloperrr/naiti.info/index.php                                    [SERVER_ADMIN] => webmaster@naiti.info                                    [DOCUMENT_ROOT] => /hsphere/local/home/webdeveloperrr/naiti.info                                    [REMOTE_ADDR] => 143.176.232.137                                    [SERVER_PORT] => 80                                    [SERVER_ADDR] => 127.0.0.1                                    [SERVER_NAME] => naiti.info                                    [SERVER_SOFTWARE] => Apache                                    [SERVER_SIGNATURE] =>                                     [HTTP_COOKIE] => SESSION=27183f1960ae23365a240b30ed5599d5; wp-settings-time-1=1522262771                                    [HTTP_ACCEPT_LANGUAGE] => ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7                                    [HTTP_ACCEPT_ENCODING] => gzip, deflate                                    [HTTP_REFERER] => http://naiti.info/index.php                                    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8                                    [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36                                    [CONTENT_TYPE] => application/x-www-form-urlencoded                                    [HTTP_UPGRADE_INSECURE_REQUESTS] => 1                                    [HTTP_ORIGIN] => http://naiti.info                                    [HTTP_CACHE_CONTROL] => max-age=0                                    [CONTENT_LENGTH] => 46                                    [HTTP_CONNECTION] => close                                    [HTTP_X_FORWARDED_PROTO] => http                                    [HTTP_X_FORWARDED_FOR] => 143.176.232.137                                    [HTTP_X_REAL_IP] => 143.176.232.137                                    [HTTP_HOST] => naiti.info                                    [REDIRECT_STATUS] => 200                                    [REDIRECT_HANDLER] => application/x-httpd-fcgiphp-56                                    [FCGI_ROLE] => RESPONDER                                    [PHP_SELF] => /index.php                                    [REQUEST_TIME_FLOAT] => 1523349966.2761                                    [REQUEST_TIME] => 1523349966                                )                            [_REQUEST] => Array                                (                                    [email] => webdeveloperrr@gmail.com                                    [pass] => Poutrou1                                )                            [_ENV] => Array                                (                                )                            [GLOBALS] => Array *RECURSION*                            [_SESSION] => Array                                (                                )                            [dbc] => mysqli Object                                (                                    [affected_rows] => 1                                    [client_info] => mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $                                    [client_version] => 50011                                    [connect_errno] => 0                                    [connect_error] =>                                     [errno] => 0                                    [error] =>                                     [error_list] => Array                                        (                                        )                                    [field_count] => 5                                    [host_info] => mysql20.hosting.ua via TCP/IP                                    [info] =>                                     [insert_id] => 0                                    [server_info] => 5.6.15-56-log                                    [server_version] => 50615                                    [stat] => Uptime: 3112141  Threads: 2  Questions: 388594528  Slow queries: 1355  Opens: 2817600  Flush tables: 1  Open tables: 14000  Queries per second avg: 124.864                                    [sqlstate] => 00000                                    [protocol_version] => 10                                    [thread_id] => 3743443                                    [warning_count] => 0                                )                            [login_errors] => Array                                (                                )                            [e] => webdeveloperrr@gmail.com                            [p] => Poutrou1                            [q] => SELECT id, username, type, pass, IF(date_expires >= NOW(), true, false) AS expired FROM users WHERE email='webdeveloperrr@gmail.com'                            [r] => mysqli_result Object                                (                                    [current_field] => 0                                    [field_count] => 5                                    [lengths] => Array                                        (                                            [0] => 1                                            [1] => 5                                            [2] => 5                                            [3] => 60                                            [4] => 1                                        )                                    [num_rows] => 1                                    [type] => 0                                )                            [row] => Array                                (                                    [id] => 1                                    [username] => admin                                    [type] => admin                                    [pass] => $2y$10$zPw7R/5PBYshXUdnsDCfRuTdrJ0lAfowseUIB1Fl3kvFEw21t0MqC                                    [expired] => 0                                )                        )                )        )    [1] => Array        (            [file] => /hsphere/local/home/webdeveloperrr/naiti.info/includes/login.inc.php            [line] => 43            [function] => session_regenerate_id            [args] => Array                (                    [0] => 1                )        )    [2] => Array        (            [file] => /hsphere/local/home/webdeveloperrr/naiti.info/index.php            [line] => 22            [args] => Array                (                    [0] => /hsphere/local/home/webdeveloperrr/naiti.info/includes/login.inc.php                )            [function] => include        ))
Link to comment
Share on other sites

Regenerating the session ID requires sending a cookie, which can only be done before anything--blank space, HTML, whatever--is sent to the browser. Something before that line, in this or another script, is creating output, which is the problem. You'll need to figure out what that is and resolve it. 

Link to comment
Share on other sites

 Share

×
×
  • Create New...