Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Admin Blank Page -please help-


baner

Recommended Posts

I just set up my server w2k3 IIS after a hard disk failure, this time with php 5 instead of php 4.3.

 

Uploaded a back up of the store and a back up of the data base.

 

The catolog pages looks to work fine, but if I try to go to admin www.mystore.com/admin all I get is BLANK page

 

any ideas?

 

thanks

Link to comment
Share on other sites

The catolog pages looks to work fine, but if I try to go to admin www.mystore.com/admin all I get is BLANK page

 

I turned on php error logging, and these were the errors:

 

Warning: session_start() [function.session-start]: open(/tmp\sess_2d51a00518534f7100c7c7af0e44525d, O_RDWR) failed: No such file or directory (2) in C:\Websites\mystore.com\web\admin\includes\functions\sessions.php on line 67

 

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\Websites\mystore.com\web\admin\includes\functions\sessions.php:67) in C:\Websites\mystore.com\web\admin\includes\functions\sessions.php on line 67

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Websites\mystore.com\web\admin\includes\functions\sessions.php:67) in C:\Websites\mystore.com\web\admin\includes\functions\sessions.php on line 67

 

Fatal error: Cannot re-assign $this in C:\Websites\mystore.com\web\admin\includes\classes\upload.php on line 31

 

Warning: Unknown: open(/tmp\sess_2d51a00518534f7100c7c7af0e44525d, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

 

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0

 

 

 

Thanks in advance!

Link to comment
Share on other sites

Okay, two errors to deal with. In both of your configure.php files make sure that the last line reads 'mysql' where indicated - storing sessions in the database and not in files. Next, read the '$this in uploads.php' link below my name.

 

Vger

Link to comment
Share on other sites

Okay, two errors to deal with. In both of your configure.php files make sure that the last line reads 'mysql' where indicated - storing sessions in the database and not in files. Next, read the '$this in uploads.php' link below my name.

 

Vger

 

Hello,

 

Thanks a lot for yor reply, both of my configure.php were right 'mysql'.

 

I made the change '$this in uploads.php' and I'm able to get the admin page back again

 

 

 

Thanks!!

Link to comment
Share on other sites

  • 3 years later...

FYI to anyone else experiencing the blank admin problem, I was able to fix it on one particular server by removing "www" from the URL listed in the admin/includes/configure.php. For some reason, the server wasn't liking that being there.

Link to comment
Share on other sites

  • 1 month later...
Okay, two errors to deal with. In both of your configure.php files make sure that the last line reads 'mysql' where indicated - storing sessions in the database and not in files. Next, read the '$this in uploads.php' link below my name.

 

Vger

 

 

Hi -

I'm having the same problem: my admin page just comes up blank with no errors displaying on it after trying to install version 2.1 one page checkout addon.

 

I don't know how to turn on the php errors. Can someone help me figure out how to get these errors to display so that I can figure out where the problem is??

 

Thanks for your reply

Liz

Link to comment
Share on other sites

/admin/includes/application_top.php

 

// Set the level of error reporting
 error_reporting(E_ALL & ~E_NOTICE);

Try this instead:

 

// Set the level of error reporting
 error_reporting(E_ALL | E_STRICT);

BACKUP THE FILE FIRST!!!

 

Change it back when the problem is found and fixed.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

/admin/includes/application_top.php

 

// Set the level of error reporting
 error_reporting(E_ALL & ~E_NOTICE);

Try this instead:

 

// Set the level of error reporting
 error_reporting(E_ALL | E_STRICT);

BACKUP THE FILE FIRST!!!

 

Change it back when the problem is found and fixed.

 

 

Ok, thanks. I did that and tried to login again to the admin, but nothing changed. No errors, just a blank page. Is there somewhere else I need to look to find the errors? Any ideas on why the blank page only comes up?

 

Liz

Link to comment
Share on other sites

See if your hosting service has an error log for your site you can examine.

 

If not, see if they can setup one for you and tell you how to find it.

 

There is one other method I can think of but it's very "tedious"...

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

ok in includes/application top.php

find this code if its not there add it should be right near the top of file

ini_set('display_errors', 1);
ini_set('log_errors', 1);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
error_reporting(E_ALL);

 

now simply create a text file called error_log.txt in root of your stores folder

now give that file write permissions 666

any errors should now be writen to that file

 

Steve

Link to comment
Share on other sites

I turned on php error logging, and these were the errors:

 

Warning: session_start() [function.session-start]: open(/tmp\sess_2d51a00518534f7100c7c7af0e44525d, O_RDWR) failed: No such file or directory (2) in C:\Websites\mystore.com\web\admin\includes\functions\sessions.php on line 67

 

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\Websites\mystore.com\web\admin\includes\functions\sessions.php:67) in C:\Websites\mystore.com\web\admin\includes\functions\sessions.php on line 67

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Websites\mystore.com\web\admin\includes\functions\sessions.php:67) in C:\Websites\mystore.com\web\admin\includes\functions\sessions.php on line 67

 

Fatal error: Cannot re-assign $this in C:\Websites\mystore.com\web\admin\includes\classes\upload.php on line 31

 

Warning: Unknown: open(/tmp\sess_2d51a00518534f7100c7c7af0e44525d, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

 

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0

 

 

 

Thanks in advance!

Hi Wilson

 

Them headers alreay sent is most likely white spaces in C:\Websites\mystore.com\web\admin\includes\functions\sessions.php

 

delete any empty lines before and after the ?> at bottom of the file

 

also make sure this folder is not read only /tmp\

 

Steve

Link to comment
Share on other sites

ok in includes/application top.php

find this code if its not there add it should be right near the top of file

ini_set('display_errors', 1);
ini_set('log_errors', 1);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
error_reporting(E_ALL);

 

now simply create a text file called error_log.txt in root of your stores folder

now give that file write permissions 666

any errors should now be writen to that file

 

Steve

Ok, I did that and then put the txt file in the root of the store folder. I tried to login and I'm still getting the blank page. I checked the txt file but nothing is written in it.

Link to comment
Share on other sites

Ok, I did that and then put the txt file in the root of the store folder. I tried to login and I'm still getting the blank page. I checked the txt file but nothing is written in it.

 

Hi Liz

 

Host has any error log ? try this goto admin then replace index.php with login.php see if you still get a blank screen, if so try uploading admin again minus catalog/admin/includes/configure.php file delete that file before upload

 

Steve

Link to comment
Share on other sites

ok in includes/application top.php

find this code if its not there add it should be right near the top of file

ini_set('display_errors', 1);
ini_set('log_errors', 1);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
error_reporting(E_ALL);

 

now simply create a text file called error_log.txt in root of your stores folder

now give that file write permissions 666

any errors should now be writen to that file

 

Steve

Hi Liz

 

silly me you need to do that in admin/includes/application top.php

 

and make that file in admin

 

Steve

Link to comment
Share on other sites

The code didn't work for me either.

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Hey Steve, this is a pretty good tip!!!

;)

 

I finally got it to work but I had to replace dirname(__FILE__) with the absolute file system path to the log file.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

The code works "as written" if you create the error log file in the same folder as the application_top file you edit.

 

dirname(__FILE__) returns the folder path to the current file (application_top.php).

 

Gotta' love this tip!

:lol:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Hi Liz

 

silly me you need to do that in admin/includes/application top.php

 

and make that file in admin

 

Steve

 

 

Thanks Steve - that worked and now I'm getting an error when I got to http://mysite.com/catalog/admin/index.php - the error I get is below:

Notice: Use of undefined constant E_STRICT - assumed 'E_STRICT' in /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/application_top.php on line 23

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/application_top.php:23) in /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/functions/sessions.php on line 102

 

Warning: Cannot modify header information - headers already sent by (output started at /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/application_top.php:23) in /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/functions/general.php on line 22

 

I get a slew of different errors when I go try catalog/admin/login.php

Notice: Use of undefined constant E_STRICT - assumed 'E_STRICT' in /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/application_top.php on line 23

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/application_top.php:23) in /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/functions/sessions.php on line 102

 

Notice: Use of undefined constant WARN_INSTALL_EXISTENCE - assumed 'WARN_INSTALL_EXISTENCE' in /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/header.php on line 14

 

Notice: Use of undefined constant WARN_CONFIG_WRITEABLE - assumed 'WARN_CONFIG_WRITEABLE' in /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/header.php on line 21

 

Notice: Use of undefined constant WARN_SESSION_DIRECTORY_NOT_WRITEABLE - assumed 'WARN_SESSION_DIRECTORY_NOT_WRITEABLE' in /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/header.php on line 28

 

Notice: Use of undefined constant WARN_SESSION_AUTO_START - assumed 'WARN_SESSION_AUTO_START' in /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/header.php on line 39

 

Notice: Use of undefined constant WARN_DOWNLOAD_DIRECTORY_NOT_READABLE - assumed 'WARN_DOWNLOAD_DIRECTORY_NOT_READABLE' in /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/header.php on line 45

 

Fatal error: Call to undefined method: messagestack->size() in /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/header.php on line 51

 

~liz

Link to comment
Share on other sites

I'd bet my last dollar you've accidentally copied /catalog/includes/header.php into the /admin/includes folder...

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Notice: Use of undefined constant E_STRICT - assumed 'E_STRICT' in /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/application_top.php on line 23
Replace E_STRICT with 2048 in the code that Jim suggested. This is not important to your original problem, but might as well make this error and the next two go away. We could try to figure out why it doesn't like E_STRICT, but I don't know that it matters.
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/application_top.php:23) in /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/functions/sessions.php on line 102

 

Warning: Cannot modify header information - headers already sent by (output started at /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/application_top.php:23) in /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/functions/general.php on line 22

Both of those are caused by the E_STRICT error. It sends output, which breaks things that assume no output until later.

Always back up before making changes.

Link to comment
Share on other sites

This is what an unmodified osCommerce-2.2rc2a /catalog/admin/includes/header.php looks like:

 

<?php
/*
 $Id: header.php 1785 2008-01-10 15:07:07Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2008 osCommerce

 Released under the GNU General Public License
*/

 if ($messageStack->size > 0) {
echo $messageStack->output();
 }
?>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<td colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.png', PROJECT_VERSION) . '</a>'; ?></td>
 </tr>
 <tr class="headerBar">
<td class="headerBarContent">  <?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '" class="headerLink">' . HEADER_TITLE_ADMINISTRATION . '</a>  |  <a href="' . tep_catalog_href_link() . '" class="headerLink">' . HEADER_TITLE_ONLINE_CATALOG . '</a>  |  <a href="http://www.oscommerce.com" class="headerLink">' . HEADER_TITLE_SUPPORT_SITE . '</a>'; ?></td>
<td class="headerBarContent" align="right"><?php echo (tep_session_is_registered('admin') ? 'Logged in as: ' . $admin['username']  . ' (<a href="' . tep_href_link(FILENAME_LOGIN, 'action=logoff') . '" class="headerLink">Logoff</a>)' : ''); ?>  </td>
 </tr>
</table>

The one from /catalog/includes is much longer and starts like this:

 

<?php
/*
 $Id: header.php 1739 2007-12-20 00:52:16Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

// check if the 'install' directory exists, and warn of its existence
 if (WARN_INSTALL_EXISTENCE == 'true') {
if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) {
  $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning');
}
 }

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Thanks Jim - you were right. I had the wrong header.php file in the admin/includes folder. I've replaced it now with the correct one and I think we are getting closer......

 

now when I try to login under catalog/admin/login.php I get this error message above the username and password fields

Notice: Use of undefined constant E_STRICT - assumed 'E_STRICT' in /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/application_top.php on line 23

 

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/application_top.php:23) in /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/functions/sessions.php on line 102

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/application_top.php:23) in /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/functions/sessions.php on line 102

 

Notice: Use of undefined constant TEXT_USERNAME - assumed 'TEXT_USERNAME' in /hermes/web02/b2005/ph.randybiehl/catalog/admin/login.php on line 130

 

Notice: Use of undefined constant TEXT_PASSWORD - assumed 'TEXT_PASSWORD' in /hermes/web02/b2005/ph.randybiehl/catalog/admin/login.php on line 131

 

Notice: Use of undefined constant BUTTON_LOGIN - assumed 'BUTTON_LOGIN' in /hermes/web02/b2005/ph.randybiehl/catalog/admin/login.php on line 132

 

I was kinda ecstatic that I saw the login boxes, but when I tried to login I get this message:

Notice: Use of undefined constant E_STRICT - assumed 'E_STRICT' in /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/application_top.php on line 23

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/application_top.php:23) in /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/functions/sessions.php on line 102

 

Warning: Cannot modify header information - headers already sent by (output started at /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/application_top.php:23) in /hermes/web02/b2005/ph.randybiehl/catalog/admin/includes/functions/general.php on line 22

 

I'm not sure if I understand what other code I was supposed to modify from the other reply - maybe that's why I'm still getting errors.

Liz

Link to comment
Share on other sites

/admin/includes/application_top.php

 

<?php
/*
 $Id: login.php 1739 2007-12-20 00:52:16Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2007 osCommerce

 Released under the GNU General Public License
*/

define('HEADING_TITLE', 'Administrator Login');

define('TEXT_USERNAME', 'Username:');
define('TEXT_PASSWORD', 'Password:');

define('TEXT_CREATE_FIRST_ADMINISTRATOR', 'No administrators exist in the database table. Please fill in the following information to create the first administrator. (A manual login is still required after this step)');

define('ERROR_INVALID_ADMINISTRATOR', 'Error: Invalid administrator login attempt.');

define('BUTTON_LOGIN', 'Login');
define('BUTTON_CREATE_ADMINISTRATOR', 'Create Administrator');
?>

You may have accidentally replaced this one with the one from /catalog/includes/languages/english/login.php

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...