Jump to content
Latest News: (loading..)
sinopia

Upgraded to PHP 7 - now few errors

Recommended Posts

Hello, I've upgrade a website to compatibility with PHP 7, follow other posts here in the forum.. Basically change the name function name into __construct..  (also have confirmed here -> https://github.com/BrockleyJohn/Responsive-osCommerce/tree/php7_compatibility_01).

But now I've a problem in product_info.php (it works fine - SEO Friendly) but the old links like product_info.php?products_id=2525 I get this errors:

Warning: Cannot modify header information - headers already sent by (output started at /home/fx/public_html/mega/product_info.php:1) in /home/fx/public_html/mega/includes/functions/general.php on line 1333
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/fx/public_html/mega/product_info.php:1) in /home/fx/public_html/mega/includes/functions/sessions.php on line 98
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/fx/public_html/mega/product_info.php:1) in /home/fx/public_html/mega/includes/functions/sessions.php on line 98
Warning: Cannot modify header information - headers already sent by (output started at /home/fx/public_html/mega/product_info.php:1) in /home/fx/public_html/mega/includes/classes/seo_friendly_urls.php on line 1505
Warning: Cannot modify header information - headers already sent by (output started at /home/fx/public_html/mega/product_info.php:1) in /home/fx/public_html/mega/includes/classes/seo_friendly_urls.php on line 1537

Also in application_top.php I've commented this line, since it was also giving me a error: 

  // Disabled due PHP 7 compatibility
  //header('Content-type: text/html; charset=utf-8');

About general.php and sessions.php they are equals to the osCommerce with PHP 7 compatibility, am I missing something?

Edited by sinopia
edit

Share this post


Link to post
Share on other sites

You need also update your add-ons and you should tell us which is your exact oscommerce version, standard or BS responsive.

For the last 2 errors you need to update your SEO URLs add-on.

I guess it's this one you need:

https://apps.oscommerce.com/36rDo&ultimate-seo-urls

The other 2 errors can be related, not sure.

 

Share this post


Link to post
Share on other sites

Hi @raiwa I've updated addons/classes compared one file per file, the version is 2.3.4.

My URL addon is http://www.johnbarounis.com/coding/oscommerce/seo-friendly-urls-addon -> which worked perfectly and I think the SEO urls are much more pretty.

Before updating to PHP 7 everything worked fine. But now old urls with product_info.php?products_id=2525 doesn't redirect, the the product_info.php works fine when entering the website.

Share this post


Link to post
Share on other sites

I already contact and got a answer from him. He's investigating what's going one.

But I don't understand why I get errors from general.php and sessions.php.

Session Directory -> /home/fx/publick_html/mega/work

Force Cookie Use -> True

Recreate Session -> True

If I disabled this I don't get errors from session.php at least. Also I think it's not working, because the folder is empty doesn't exist any sess_random...

My configure.php:

  define('HTTP_SERVER', 'https://www.aminhatshirt.com');
  define('HTTPS_SERVER', 'https://www.aminhatshirt.com');
  define('ENABLE_SSL', true);
  define('HTTP_COOKIE_DOMAIN', 'aminhatshirt.com');
  define('HTTPS_COOKIE_DOMAIN', 'aminhatshirt.com');
  define('HTTP_COOKIE_PATH', '/');
  define('HTTPS_COOKIE_PATH', '/');
  define('DIR_WS_HTTP_CATALOG', '/mega/');
  define('DIR_WS_HTTPS_CATALOG', '/mega/');

 

Share this post


Link to post
Share on other sites

@raiwa just noticed now that with the addon SEO Friendly url disabled the old url works but get this:

 

  <br />
  <b>Warning</b>: Cannot modify header information - headers already sent by (output started at /home/aminhatshirt/public_html/mega/product_info.php:1) in <b>/home/aminhatshirt/public_html/mega/includes/functions/general.php</b> on line <b>1334</b><br />
  <br />
  <b>Warning</b>: session_start(): Cannot send session cookie - headers already sent by (output started at /home/aminhatshirt/public_html/mega/product_info.php:1) in <b>/home/aminhatshirt/public_html/mega/includes/functions/sessions.php</b> on line <b>98</b><br />
  <br />
  <b>Warning</b>: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/aminhatshirt/public_html/mega/product_info.php:1) in <b>/home/aminhatshirt/public_html/mega/includes/functions/sessions.php</b> on line <b>98</b><br />

Share this post


Link to post
Share on other sites
17 minutes ago, sinopia said:

Force Cookie Use -> True

Recreate Session -> True

If I disabled this I don't get errors from session.php at least. Also I think it's not working, because the folder is empty doesn't exist any sess_random...

I just checked and found that in the latest PHP7 compatible 2.3.4.1 BS responsive version both parameters are set to "false" by default. I have it like this set in my live store and everything works fine.

I remember also in some other thread that it is recommended like this. Sessions anyway are stored in the database. Try to find some resource here, there were more reports about.

Edited by raiwa

Share this post


Link to post
Share on other sites

I've disabled those two but getting:

session_start(): Cannot send session cache limiter - headers already sent (output started at /home/aminhatshirt/public_html/mega/product_info.php:1) in <b>/home/aminhatshirt/public_html/mega/includes/functions/sessions.php

Even replacing replacing this -> https://github.com/BrockleyJohn/Responsive-osCommerce/tree/php7_compatibility_01/includes/functions

Share this post


Link to post
Share on other sites

@sinopia,

- try to delete your browsers cache

- try with another browser

- check if your cache directory has the correct permissions

- switch off any caching (admin=>configure=>cache)

- recheck that you applied all php7 updates

 

Sorry, I have no more advice

Share this post


Link to post
Share on other sites

@raiwa misconfiguration at PHP:

Checked PHP options and in cPanel I've just found this:
session.save_path                             /var/cpanel/php/sessions/ea-php70
It was using /var/cpanel/php/sessions/ea-php56 but version was PHP 7 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×