Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fatal Errors in session.php


Tao

Recommended Posts

I just installed OScommerce in a Linux server which runs Apache2. PHP4 and MySQL had been installed. After the installation, the catalog page looked good except there was an error massage always in the bottom of catalog pages.

 

 

Fatal error: Call to undefined function: session_write_close()  in /srv/www/htdocs/catalog/includes/functions/sessions.php on line 106

 

Moreover, when I tried to access the admin platform, there were two error massages rather than a blue login page.

 

 

Parse error: parse error, expecting `','' or `';'' in /srv/www/htdocs/catalog/admin/includes/classes/sessions.php on line 33

 

Fatal error: Call to undefined function: session_set_save_handler() in /srv/www/htdocs/catalog/admin/includes/functions/sessions.php on line 63

 

 

Did I need to modify the source code? Thanks for any help.

Link to comment
Share on other sites

After I took off the 106th line in "./catalog/includes/functions/sessions.php" ( I commented this line), the error alert

 

Fatal error: Call to undefined function: session_write_close()  in /srv/www/htdocs/catalog/includes/functions/sessions.php on line 106

 

was not there anymore.

 

Then I commented the 33rd line again in "./catalog/admin/includes/classes/sessions.php" , and went to Admin page. The error alerts

 

Parse error: parse error, expecting `','' or `';'' in /srv/www/htdocs/catalog/admin/includes/classes/sessions.php on line 33

 

Fatal error: Call to undefined function: session_set_save_handler() in /srv/www/htdocs/catalog/admin/includes/functions/sessions.php on line 63

 

disappeared and the Amin page appeared with four warnings

 

Warning: reset(): Passed variable is not an array or object in /srv/www/htdocs/catalog/admin/includes/classes/sessions.php on line 306

 

Warning: Variable passed to each() is not an array or object in /srv/www/htdocs/catalog/admin/includes/classes/sessions.php on line 306

 

Warning: reset(): Passed variable is not an array or object in /srv/www/htdocs/catalog/admin/includes/classes/sessions.php on line 306

 

Warning: Variable passed to each() is not an array or object in /srv/www/htdocs/catalog/admin/includes/classes/sessions.php on line 306

 

Please note that there is no admin login page before the admin page shows up. If I refresh the admin page, all four warnings will be not there anymore. Is there some body can figure out what is the reason for this problem? Did I miss some files when I download OSCommerce? Actually, I downloaded it again and reinstalled OSCommerce, but the same problem is still there. Thanks for any help.

 

 

 

 

 

 

I just installed OScommerce in a Linux server which runs Apache2.  PHP4 and MySQL had been installed.  After the installation, the catalog page looked good except there was an error massage always in the bottom of catalog pages.

Moreover, when I tried to access the admin platform, there were two error massages rather than a blue login page. 

Did I need to modify the source code?  Thanks for any help.

Link to comment
Share on other sites

Look...stop commenting out lines if you don't know what you are doing.

 

Take a look at the errors that you presented. Do you know how to debug this or process the information that it is presenting??

 

The first error is being thrown from /functions/session.php which tells me the script is functioning properly (minus the error) in reading PHP >4.0.4

 

However, when you comment the lines it then throws an error in classes/sessions.php which tells me the script thinks you're running PHP3.

 

Your causing more bugs than your fixing. Read this thread: http://www.oscommerce.com/forums/index.php?showtopic=117713

 

What OS are you running? Is PHP installed as a module? Have you written a debug script? What else are doing to fix the problem besides commenting lines that you have no idea what they are for?

Link to comment
Share on other sites

copy back original untouched source of the files you commented things out of. you probably edited the files incorrectly the first time around. it is not wise to comment out lines for things dealing with sessions, security, as all it does is cause confusion and problems.

then once you have copied the original files over the changed, see what happens.

 

what were you adding that required you to edit the sessions.php file?

Link to comment
Share on other sites

On PHP Website, someone also claimed that session_write_close() could not work for his PHP 4.3.8. Then he used session_flush() to replace session_write_close(), and it worked for him. My PHP version is 4.3.4, and I also tried to use session_flush() to replace session_write_close(). The fatal error message in catalog page was gone! So, it seems session_write_close() is not good for all PHP ever the version is later than 4.0.4. By the way, my OS is Suse Linux 9.1, the PHP(4.3.4) comes from one of Suse Linux Installation disks.

 

However, the fatal errors in admin page is still there. If I use the original php code, the error message is:

Parse error: parse error, expecting `','' or `';'' in /srv/www/htdocs/catalog/admin/includes/classes/sessions.php on line 33

 

Fatal error: Call to undefined function: session_set_save_handler() in /srv/www/htdocs/catalog/admin/includes/functions/sessions.php on line 63

 

Do you guys know what problem it is?

Link to comment
Share on other sites

  • 3 weeks later...
On PHP Website, someone also claimed that session_write_close() could not work for his PHP 4.3.8.  Then he used session_flush() to replace session_write_close(), and it worked for him.  My PHP version is 4.3.4, and I also tried to use session_flush() to replace session_write_close().  The fatal error message in catalog page was gone!  So, it seems session_write_close() is not good for all PHP ever the version is later than 4.0.4.  By the way, my OS is Suse Linux 9.1, the PHP(4.3.4) comes from one of Suse Linux Installation disks. 

 

However, the fatal errors in admin page is still there. If I use the original php code, the error message is:

 

Do you guys know what problem it is?

 

Yes.

 

You do not have the php session extension installed. Some distributions include most of the extensions, some don't, and some make them optional during the install process. I found this out myself on freebsd where the php port does not install any extensions, and there are now separate ports for each extension.

 

Chris

Link to comment
Share on other sites

  • 2 months later...

Archived

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

×
×
  • Create New...