Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

session_start in error logs


Thelostfleet

Recommended Posts

Greetings,

 

I've changed my production server a few weeks ago and since then, when I check my error log file I get many errors like these :

FastCGI: server "/fcgi-bin-php5-fpm" stderr: PHP message: PHP Warning:  session_start(): Trying to destroy uninitialized session in /home/*****EDITED***/includes/functions/sessions.php on line 95
FastCGI: server "/fcgi-bin-php5-fpm" stderr: PHP message: PHP Warning:  session_start(): Failed to decode session object. Session has been destroyed in /home/*****EDITED***/includes/functions/sessions.php on line 95

On line 95 I've got :

return session_start();

The navigation on the site works. Customers can log-in and place orders.

 

Any clue to what may be the cause of these errors ?

 

Many thanks

Link to comment
Share on other sites

It would be helpful to know what osCommerce version you're using, what the PHP version was on the old server (where it worked OK), and what the PHP version is on the new server (where you get this error). If you're trying to run a very old osC on PHP 5.6 or 7, you might get errors of some sort.

Link to comment
Share on other sites

  • 2 weeks later...

After some extensive search in my logs, it seems that this problem is due to some personnal development.

 

I've changed the advanced_search page with jquery to add some products suggestion when a customer enters more than 4 letters in the search field. Through jQuery.post() I send queries to the database and show the queries results (if any) in a dropbox.

If one do not take into account the error messages in my logs, everything works fine : I got correct results and they are displayed without problem. The error messages in my logs do appear when one customers enters specials characters such as : é, à, è ... in the search field.

This tends to suggest a charset problem.

 

This post : http://stackoverflow.com/questions/33051842/session-start-is-not-success-when-use-multi-byte-into-the-session-in-cakephp3 tends to confirm this feeling.

 

My site and my base are in latin1 (and I can't switch it to UTF8). The Mysql charset is UTF-8 Unicode  and the collation for the Mysql connexion is utf8_general_ci. I've switched the charset and collation of the Session table to UTF-8 without any improvement.

 

I'm looking to see if it's possible to specify a charset for the jQuery.post() other than the UTF-8

 

If someone has a good knowledge of jquery charset , his help would be appreciated :)

 

P.S. : What makes me mad is that on wamp everything works fine.

Link to comment
Share on other sites

You stated that your base encoding is latin-1 and everything in the database us UTF_8. This will never work correctly. The encoding of all characters must match the encoding specified in the head section of the page. I suggest that you change all encoding to UTF-8.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...