Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 13 of 13
  1. #1
    Member This forum account has been confirmed by cPanel staff to represent a vendor. Radio_Head's Avatar
    Join Date
    Feb 2002
    Posts
    2,064

    Default oscommerce and php safe mode

    I am running php safe mode from several weeks now , without any big problem .

    But I found now that oscommerce generate an error using php safe mode ...


    Warning: is_dir() [function.is-dir]: SAFE MODE Restriction in effect. The script whose uid is 32003 is not allowed to access /tmp owned by uid 0 in /home/test/public_html/oscommerce/includes/header.php on line 30


    Any idea to avoid this error ?
    Stop SPAM & VIRUS :: ASSP Deluxe for cPanel http://www.grscripts.com
    █ ASSP Deluxe is supported by Fritz Borgstedt,ASSP main developer.

  2. #2
    Member This forum account has been confirmed by cPanel staff to represent a vendor. Radio_Head's Avatar
    Join Date
    Feb 2002
    Posts
    2,064

    Smile

    Ok I solved ..

    when cpanel execute the oscommerce installation tag I execute this php line ..

    <?
    shell_exec("replace \"define('STORE_SESSIONS', '')\" \"define('STORE_SESSIONS', 'mysql')\" -- /home/$auserb/public_html/$url/includes/configure.php");
    ?>


    In this way oscommerce works fine with php safe mode saving
    the session on mysql .
    Stop SPAM & VIRUS :: ASSP Deluxe for cPanel http://www.grscripts.com
    █ ASSP Deluxe is supported by Fritz Borgstedt,ASSP main developer.

  3. #3
    Member
    Join Date
    Oct 2002
    Posts
    18

    Default

    you can also define the session in the OSC configure.php file.

    Look in /includes/configure.php

    last line asks where you want to store sessions. Just insert 'mysql' in between the qoutes.


    This will have to be done for both the store frontend and the admin area.

  4. #4
    Member This forum account has been confirmed by cPanel staff to represent a vendor. Radio_Head's Avatar
    Join Date
    Feb 2002
    Posts
    2,064

    Default

    Originally posted by mrbill
    you can also define the session in the OSC configure.php file.

    Look in /includes/configure.php

    last line asks where you want to store sessions. Just insert 'mysql' in between the qoutes.


    This will have to be done for both the store frontend and the admin area.
    yes , infact my php lines above make exactly that They assign
    mysql on configure.php .
    Stop SPAM & VIRUS :: ASSP Deluxe for cPanel http://www.grscripts.com
    █ ASSP Deluxe is supported by Fritz Borgstedt,ASSP main developer.

  5. #5
    Member
    Join Date
    Sep 2001
    Posts
    87

    Default

    Why not just modify the configure.php in the osCommerce tar package:
    /usr/local/cpanel/addons/osCommerce/pkg.tar.gz

    Will cpanel updates overwrite this?

    Also, are there other bad consequences of turning on safe mode for users?

  6. #6
    Member
    Join Date
    Sep 2001
    Posts
    87

    Default

    I modified the osCommerce package file located in /usr/local/cpanel/addons/osCommerce/pkg.tar.gz so that the configure.php file in there uses mysql to store sessions. However I noticed that it's always reverting back. This tells me Cpanel updates are overwriting it.

    I can do a chattr but then if there are critical updates I might miss them. How are you guys doing the php replace script upon user install of osC? Modify the cpanel html files?

    cPanel.net Support Ticket Number:

  7. #7
    Member cass's Avatar
    Join Date
    Jul 2002
    Location
    Argentina/USA/Mexico
    Posts
    354

    Default

    Anyone submitted a ticket on this ?

    maybe it's just more simple to tell DarkOrb to put 'mysql' as default ...

    I think most of us use safe mode ... you know what that evil php shell script does ... heh

    Regards.

    cPanel.net Support Ticket Number:
    Carlos Ariel Sepúlveda
    CAS company :: 1997-2011, 14 Years! :: Dedicated Attitude
    http://www.cascompany.com :: Providing CPANEL/WHM Servers since 2002 !

  8. #8
    NiN
    NiN is offline
    Member
    Join Date
    Apr 2003
    Location
    Braga, Portugal
    Posts
    29

    Default Replace the package???

    Why do you do things the hard way? Just do this:
    Uncoment the second line in each (remove '#'):

    #do we need this?
    #regsrep("$installdir/includes/configure.php","\\(\'STORE_SESSIONS\'","define('STORE_SESSIONS', 'mysql');");


    #do we need this?
    #regsrep("$installdir/admin/includes/configure.php","\(\'STORE_SESSIONS\'","define('STORE_SESSIONS', 'mysql');");


    in the file:
    /usr/local/cpanel/addons/osCommerce/install

    Regards,
    ~ Dani
    Last edited by NiN; 06-04-2003 at 05:28 AM.
    ~ DM

  9. #9
    Member This forum account has been confirmed by cPanel staff to represent a vendor. Radio_Head's Avatar
    Join Date
    Feb 2002
    Posts
    2,064

    Default

    oscommerce recently started again to show safe mode on errors ..

    as it seems storing session on mysql is no more enough (!)

    Anyone found a turnaround ?
    Stop SPAM & VIRUS :: ASSP Deluxe for cPanel http://www.grscripts.com
    █ ASSP Deluxe is supported by Fritz Borgstedt,ASSP main developer.

  10. #10
    Member rs-freddo's Avatar
    Join Date
    May 2003
    Location
    Australia
    Posts
    836
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by Radio_Head
    oscommerce recently started again to show safe mode on errors ..

    as it seems storing session on mysql is no more enough (!)

    Anyone found a turnaround ?
    Did you find a solution? I'm getting safe mode errors even though sessions are set to use mysql.
    Michael

  11. #11
    Member This forum account has been confirmed by cPanel staff to represent a vendor. Radio_Head's Avatar
    Join Date
    Feb 2002
    Posts
    2,064

    Default

    Open
    /home/user/public_html/catalog/include

    change
    define('STORE_SESSIONS', '');
    with
    define('STORE_SESSIONS', 'mysql');

    Open
    /home/user/public_html/catalog/includes/functions/sessions.php

    change

    function tep_session_save_path($path = '') {
    if (!empty($path)) {
    return session_save_path($path);
    } else {
    return session_save_path();
    }
    }


    with

    function tep_session_save_path($path = '') {
    if (!empty($path)) {
    return @session_save_path($path);
    } else {
    return @session_save_path();
    }
    }


    open
    /home/user/public_html/catalog/admin/includes/functions/sessions.php

    change

    function tep_session_save_path($path = '') {
    if ($path != '') {
    return session_save_path($path);
    } else {
    return session_save_path();
    }
    }

    with

    function tep_session_save_path($path = '') {
    if ($path != '') {
    return @session_save_path($path);
    } else {
    return @session_save_path();
    }
    }






    I am using these changes without any problem from 1 sept .( I am using
    a customized php cpanel skin , and I aplly these change automatically using the
    php shell exec command )-
    Last edited by Radio_Head; 09-24-2005 at 05:48 AM.
    Stop SPAM & VIRUS :: ASSP Deluxe for cPanel http://www.grscripts.com
    █ ASSP Deluxe is supported by Fritz Borgstedt,ASSP main developer.

  12. #12
    Member rs-freddo's Avatar
    Join Date
    May 2003
    Location
    Australia
    Posts
    836
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Thank you very much - that works fine!
    Michael

  13. #13
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Mar 2005
    Posts
    34

    Red face solution

    We use the following solution:

    1. Login into WebHost Manager
    2. Go to phpMyAdmin
    3. Find the corresponding database
    4. Browse the 'configuration' table.
    5. Change the record WHERE configuration_key says "SESSION_WRITE_DIRECTORY" and change the configuration_value to /home/username/tmp

    ofcourse username should be replaced with the correct username.

    This is a bugfix for the session_save_path problem and also makes the osCommerce installation more secure.
    dutch howto's and articles http://turnred.net

Similar Threads & Tags
Similar threads

  1. php safe mode
    By thewebhosting in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 05-19-2009, 01:23 PM
  2. PHP Safe Mode
    By summy in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 05-31-2004, 06:18 AM
  3. PHP safe mode
    By hugo24 in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 05-20-2003, 03:58 AM
  4. PHP Safe Mode
    By IT Hosting in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-04-2002, 07:05 PM
  5. Php Safe Mode
    By Brad in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-19-2001, 04:12 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube