Hi all,
I'm new here so forgive me if this has been asked before.
I have installed oscommerce for the first time and I'm trying to configure it but I getting the next errors at the top of the browser:

Warning: session_save_path() [function.session-save-path]: SAFE MODE Restriction in effect. The script whose uid is 710 is not allowed to access owned by uid 0 in /directory path/public_html/catalog/admin/includes/functions/sessions.php on line 110
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /directory path/public_html/catalog/admin/includes/functions/sessions.php:110) in /directory path/public_html/catalog/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 /directory path/public_html/catalog/admin/includes/functions/sessions.php:110) in /directory path/public_html/catalog/admin/includes/functions/sessions.php on line 67

I have set all the permissions as the documentation instructs...

What am I doing wrong?

thanks for all your help :-|

Dani AI

Generated

Short expert summary and practical fixes (adds to , builds on and )

The three warnings come from one root cause: PHP is failing to use the configured session directory (safe_mode / open_basedir / ownership restrictions), and that initial warning is printed before session_start(), which produces the “Cannot send session cookie / headers already sent” cascade. Fix the session-save-path problem first — the header warnings are a side‑effect. (stackoverflow.com)

Quick diagnosis (do this first)

  • Upload a tiny file named phpinfo.php in your catalog and open it in a browser to see the PHP settings the host is actually using:
    <?php
    phpinfo();

    Look for session.save_path, open_basedir and any safe_mode setting. That tells whether you can change settings from .htaccess/.user.ini or must ask the host. session_save_path() must be set before session_start(). (php.net)

Three practical fixes (try them in this order)

  1. Fastest, non-server fix: create a sessions folder inside your web account (for example /home/you/.../catalog/tmp), make it writable (owner = your account, mode 700/755), then point osCommerce at it via Admin → Configuration → Sessions. If you cannot reach Admin, update the DB directly (phpMyAdmin) — change SESSION_WRITE_DIRECTORY to your path (or to tmp for the safe_mode workaround):

    UPDATE configuration
    SET configuration_value = 'tmp'
    WHERE configuration_key = 'SESSION_WRITE_DIRECTORY';

    Many osCommerce users solved this way when hosts left safe_mode/open_basedir on. (oscommerce.com)

  2. If you can edit PHP settings: set session.save_path in a per‑user ini (.user.ini / phprc) or with ini_set() before any output, e.g.:

    ini_set('session.save_path', '/home/you/.../catalog/tmp');
    session_start();

    Remember this must run before session_start(). (php.net)

  3. Use DB sessions (longer term): set define('STORE_SESSIONS','mysql') in both configure files and confirm the DB tables are present — note older osC versions sometimes still check the session directory, so combine with (1) if needed. Safe mode was deprecated/removed in later PHP releases; upgrading PHP or asking the host to adjust open_basedir is the real fix. (wiki.php.net)

Final troubleshooting tips

  • Fix the underlying permission/owner problem rather than suppressing errors; error output before session_start() causes the cookie/header failure. Check files for BOM/leading whitespace, turn off display_errors in production, and inspect server error logs if the above steps don’t help. (php.net)

If any step fails, paste the phpinfo() session/open_basedir lines and the exact configure/DB change you made and the next suggestions can be tailored.

Recommended Answers

All 3 Replies

you are getting this because your host has enables safe mode in php. You can not change the session save path with safe mode on (i think). You need to leave that feature blank and move on. You can go to a new host or fwd the error to your host and see what they can do for you.

Hi,

Thanks!
I've emailed the host about the safe mode... will just have to wait and see what they say about it...

remove session path (/tmp) from

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.