Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 26
  1. #1
    SDM
    SDM is offline
    Registered User
    Join Date
    Jul 2003
    Posts
    1

    Default PHP Nuke & Oscommerce

    Hi,

    What's the chance of getting these add on scripts updated?
    PHP Nuke is not up to 6.7 and oSc just released 2.2 M2, which deals with some security issues, and makes it easer to submit to search engines..

    Thanks

    cPanel.net Support Ticket Number:

  2. #2
    Member
    Join Date
    Jun 2003
    Posts
    396

    Default osCommerce update Script

    It is ugly but it works:

    Update the cPanel scripts to osCommerce 2.2 Milestone 2 (07/12/2003)

    save the file, rename to osco
    # Al Smith
    # Update cPanel osCommerce software to later version
    # Get the osCommerce download then create a install pkg for cPanel

    # Start in the /tmp directory
    cd /tmp

    # Update this link to get the latest version. This example is the osCommerce 2.2 Milestone 2 (07/12/2003)
    #
    URL=http://heanet.dl.sourceforge.net/sourceforge/tep/oscommerce-2.2ms2.tar.gz

    wget $URL

    # Unpack it
    tar zxvf oscommerce-2.2ms2.tar.gz

    DIR=/tmp/oscommerce-2.2ms2

    # this unpacks to a oscommerce-2.2ms2 directory with a catalog directory
    # the catalog has the admin directory beneath it. we need to reverse the
    # structure of the pkg.tar.gz. it has pkg/catalog and pkg/admin in it.

    mkdir /tmp/os /tmp/os/catalog /tmp/os/admin

    cd $DIR
    cp -r catalog /tmp/os/catalog
    cd catalog
    cp -r admin /tmp/os/admin

    rm -rf /tmp/os/catalog/catalog/admin
    mv /tmp/os /tmp/pkg

    # make sure we are in the /tmp directory
    cd /tmp
    tar cvfz pkg.tar.gz pkg

    # Now put it in the /usr/local/cpanel/addons/osCommerce directory
    osDir=/usr/local/cpanel/addons/osCommerce
    cp $osDir/pkg.tar.gz $osDir/pkg.tar.gz.old
    cp pkg.tar.gz $osDir

    # Clean up old files
    rm pkg.tar.gz
    rm -rf pkg
    rm -rf /tmp/os /tmp/os/catalog /tmp/os/admin

    #
    # End
    #
    cPanel.net Support Ticket Number:

    cPanel.net Support Ticket Number:
    -Albert

  3. #3
    Member
    Join Date
    Feb 2002
    Posts
    53

    Default

    WOW!!

    That works great.

    Thanks

    cPanel.net Support Ticket Number:

  4. #4
    Member
    Join Date
    Sep 2003
    Location
    NY, USA
    Posts
    40

    Unhappy Doh!

    Firstly, good work on the script...

    My only problem... I ran it exactly as you wrote, and oscommerce now installs without the user permission error I had previously... but it looks for all images in /images instead of ./images .. so on my server it looks for http://<myserver>/images instead of http://<myserver>/osc/images

    Any idea how to fix this other than moving the images into /images ? I've been looking but can't find a option in the oscommerce admin site to change this.

    Regards,
    Michael

    cPanel.net Support Ticket Number:

  5. #5
    Member
    Join Date
    Jun 2003
    Posts
    396

    Default oscommerce install script

    The install script needs to be updated.
    The new version uses:
    define('DIR_WS_HTTP_CATALOG', '');
    define('DIR_WS_HTTPS_CATALOG', '');
    so you need to edit the install script:

    Find
    [QUOTE]regsrep("$installdir/includes/configure.php","\\(\'DIR_WS_CATALOG\'","define(
    'DIR_WS_CATALOG', '$installpath/');");[\QUOTE]

    replace with
    regsrep("$installdir/includes/configure.php","\\(\'DIR_WS_HTTP_CATALOG\'","define(
    add a line with
    regsrep("$installdir/includes/configure.php","\\(\'DIR_WS_HTTPS_CATALOG\'","define(
    for the SSL.

    That should do it.

    Here is my install from /usr/local/cpanel/addon/osCommerce
    Code:
    #!/usr/bin/perl
    
    BEGIN {
            push(@INC,"/usr/local/cpanel");
    }
    
    use SafeFile;
    
    #VARIBLES
    my $domain = '%domain%';
    my $installpath = '%installpath%';
    my $modulename = '%modulename%';
    my $modulepath = '%modulepath%';
    my $homedir = '%homedir%';
    my $user = '%user%';
    my $installdir = '%installdir%';
    my $publichtml = '%public_html%';
    my $sqldb = '%sqldb%';
    my $sqluser = '%sqluser%';
    my $sqlpass = '%sqlpass%';
    my $sqlserver = '%sqlhost%';
    my $username = '%username%';
    my $password = '%password%';
    
    print "We are installing in $installdir...\n";
    
    system("mysql -u${sqluser} -p${sqlpass} ${sqldb} < $installdir/pkg/catalog/catalog
    /install/oscommerce.sql");
    
    system("mv $installdir/pkg/catalog/catalog/* $installdir/");
    system("mv $installdir/pkg/admin/admin $installdir/");
    system("mv $installdir/pkg/tep-docs $installdir/");
    
    
    regsrep("$installdir/includes/configure.php","\\(\'HTTP_SERVER\'","define('HTTP_SE
    RVER', 'http://$domain');");
    regsrep("$installdir/includes/configure.php","\\(\'HTTPS_SERVER\'","define('HTTPS_
    SERVER', 'https://$domain');");
    regsrep("$installdir/includes/configure.php","\\(\'DIR_WS_HTTP_CATALOG\'","define(
    'DIR_WS_CATALOG', '$installpath/');");
    regsrep("$installdir/includes/configure.php","\\(\'DIR_WS_HTTPS_CATALOG\'","define
    ('DIR_WS_CATALOG', '$installpath/');");
    regsrep("$installdir/includes/configure.php","\\(\'DB_SERVER\'","define('DB_SERVER
    ', '$sqlserver');");
    regsrep("$installdir/includes/configure.php","\\(\'DB_SERVER_USERNAME\'","define('
    DB_SERVER_USERNAME', '$sqluser');");
    regsrep("$installdir/includes/configure.php","\\(\'DB_SERVER_PASSWORD\'","define('
    DB_SERVER_PASSWORD', '$sqlpass');");
    regsrep("$installdir/includes/configure.php","\\(\'DB_DATABASE\'","define('DB_DATA
    BASE', '$sqldb');");
    #do we need this?
    #regsrep("$installdir/includes/configure.php","\\(\'STORE_SESSIONS\'","define('STO
    RE_SESSIONS', 'mysql');");
    unlink("$installdir/includes/configure.php.tmpeditlib");
    
    regsrep("$installdir/admin/includes/configure.php","\\(\'HTTP_SERVER\'","define('H
    TTP_SERVER', 'http://$domain');");
    regsrep("$installdir/admin/includes/configure.php","\\(\'HTTPS_SERVER\'","define('
    HTTPS_SERVER', 'https://$domain');");
    regsrep("$installdir/admin/includes/configure.php","\\(\'DIR_WS_ADMIN\'","define('
    DIR_WS_ADMIN', '${installpath}/admin/');");
    regsrep("$installdir/admin/includes/configure.php","\\(\'DIR_WS_CATALOG\'","define
    ('DIR_WS_CATALOG', '${installpath}/');");
    regsrep("$installdir/admin/includes/configure.php","\\(\'DB_SERVER\'","define('DB_
    SERVER', '$sqlserver');");
    regsrep("$installdir/admin/includes/configure.php","\\(\'DB_SERVER_USERNAME\'","de
    fine('DB_SERVER_USERNAME', '$sqluser');");
    regsrep("$installdir/admin/includes/configure.php","\\(\'DB_SERVER_PASSWORD\'","de
    fine('DB_SERVER_PASSWORD', '$sqlpass');");
    regsrep("$installdir/admin/includes/configure.php","\\(\'DB_DATABASE\'","define('D
    B_DATABASE', '$sqldb');");
    #do we need this?
    #regsrep("$installdir/admin/includes/configure.php","\(\'STORE_SESSIONS\'","define
    ('STORE_SESSIONS', 'mysql');");
    unlink("$installdir/admin/includes/configure.php.tmpeditlib");
    
    chmod(0777,"$installdir/images");
    mkdir("$installdir/admin/backups",0777);
    chmod(0777,"$installdir/admin/backups");
    
    system("rm","-rf","$installdir/install");
    
    link("$installdir/default.php","$installdir/index.php");
    
    print "<b>Complete!</b>\n";
    
    print "<br>You can access your new cart at: <a href=\"http://$domain/$installpath/
    \">http://${domain}${installpath}/</a><br>\n";
    print "<br>You can access the admin interface at: <a href=\"http://$domain/$instal
    lpath/admin/\">http://${domain}${installpath}/admin/</a> with the username: ${user
    name}, and the password:
    ${password}.<br>\n";
    print "<br><br>\n";
    
    sub regsrep {
       my($file,$old,$new) = @_;
       $filelock = SafeFile::safeopen(\*FH,"$file");
       $fileeditlock = SafeFile::safeopen(\*FHT,">$file.tmpeditlib");
       while(<FH>) {
          if ($_ =~ /^$/ || $_ eq "\n" || $_ eq "\r\n") {
             print FHT "$_";
          } elsif($_ =~ /$old/) {
            $result = $1;
             my $mnew = $new;
            $mnew =~ s/\$1/$result/g;
             print FHT "$mnew\n";
          } else {
             print FHT $_;
          }
       }
       SafeFile::safeclose(\*FH,$filelock);
       SafeFile::safeclose(\*FHT,$fileeditlock);
       $fileeditlock = SafeFile::safeopen(\*FHT,"$file.tmpeditlib");
       $filelock = SafeFile::safeopen(\*FH,">$file");
       while(<FHT>) { print FH $_ };
       SafeFile::safeclose(\*FH,$filelock);
       SafeFile::safeclose(\*FHT,$fileeditlock);
    }
    I had to redo mine since the keep update is turned on on the WHM so keep a copy around or Turn it Off.

    cPanel.net Support Ticket Number:
    -Albert

  6. #6
    Member isputra's Avatar
    Join Date
    May 2003
    Location
    Mbelitar
    Posts
    593

    Default

    So .. how to update php-nuke script then?
    Anyone knows step by step like oscommerce above would be appreciated if you share it with us

    Ah .. yes i almost forget.
    The install script for oscommerce like asmithjr wrote has a little error on product link. Here the correction :

    Originally posted by asmithjr
    regsrep("$installdir/includes/configure.php","\\(\'DIR_WS_HTTP_CATALOG\'","define(
    'DIR_WS_CATALOG', '$installpath/');");
    regsrep("$installdir/includes/configure.php","\\(\'DIR_WS_HTTPS_CATALOG\'","define
    ('DIR_WS_CATALOG', '$installpath/');");
    [/code]
    And the correction :

    Code:
    regsrep("$installdir/includes/configure.php","\\('DIR_WS_HTTP_CATALOG'","define('DIR_WS_HTTP_CATALOG', '$installpath/');");
    regsrep("$installdir/includes/configure.php","\\('DIR_WS_HTTPS_CATALOG'","define('DIR_WS_HTTPS_CATALOG', '$installpath/');");
    cPanel.net Support Ticket Number:
    Last edited by isputra; 09-12-2003 at 08:05 PM.
    It's me ...... It's me ......

  7. #7
    Member
    Join Date
    Sep 2003
    Location
    NY, USA
    Posts
    40

    Default hmmm

    Other than his being on 4 lines instead of your 2, what's the difference?

    cPanel.net Support Ticket Number:

  8. #8
    Member isputra's Avatar
    Join Date
    May 2003
    Location
    Mbelitar
    Posts
    593

    Default

    Code from asmithjr :

    Code:
    regsrep("$installdir/includes/configure.php","\\('DIR_WS_HTTP_CATALOG'","define('DIR_WS_CATALOG', '$installpath/');");
    regsrep("$installdir/includes/configure.php","\\('DIR_WS_HTTPS_CATALOG'","define('DIR_WS_CATALOG', '$installpath/');");
    And the correction :

    Code:
    regsrep("$installdir/includes/configure.php","\\('DIR_WS_HTTP_CATALOG'","define('DIR_WS_HTTP_CATALOG', '$installpath/');");
    regsrep("$installdir/includes/configure.php","\\('DIR_WS_HTTPS_CATALOG'","define('DIR_WS_HTTPS_CATALOG', '$installpath/');");
    See the difference ?

    cPanel.net Support Ticket Number:
    It's me ...... It's me ......

  9. #9
    Member
    Join Date
    Jun 2003
    Posts
    396

    Default thanks for the osc update

    I see i put the wrong script in. Thanks for catching it for this update.

    cPanel.net Support Ticket Number:
    -Albert

  10. #10
    Member
    Join Date
    Sep 2003
    Location
    NY, USA
    Posts
    40

    Thumbs up

    Ah yes, thankyou very much

    cPanel.net Support Ticket Number:

  11. #11
    Member isputra's Avatar
    Join Date
    May 2003
    Location
    Mbelitar
    Posts
    593

    Default

    No problem

    cPanel.net Support Ticket Number:
    It's me ...... It's me ......

  12. #12
    Member rpmws's Avatar
    Join Date
    Aug 2001
    Location
    back woods of NC, USA
    Posts
    1,858

    Default

    Hi guys. I have a problem with the install script (i think).

    I have a few customers trying to install this. It's giving 1044 mysql errors on the install output in cPanel. I tried the install on multiple accounts. Same result. I tried the script posted here for updating and sure enough it looks great and works like the other version.. well same result. I can't get the thing to install and yes I have versions running that were installed fine a week or so ago and yes plenty of mySQL: db's on user account.

    any clues??

    cPanel.net Support Ticket Number:
    Just keeping my "eye" on things....
    R. Paul Mathews
    RPMWS - diehard cPanel Nutcase

  13. #13
    Member rpmws's Avatar
    Join Date
    Aug 2001
    Location
    back woods of NC, USA
    Posts
    1,858

    Default

    actually I just verified this on 4 servers, 5 domains. I get this error when loading the index page on the osc dir.

    1046 - No Database Selected

    select configuration_key as cfgKey, configuration_value as cfgValue from configuration

    cPanel.net Support Ticket Number:
    Just keeping my "eye" on things....
    R. Paul Mathews
    RPMWS - diehard cPanel Nutcase

  14. #14
    cPanel Verified Vendor This forum account has been confirmed by cPanel staff to represent a vendor.
    Join Date
    Jan 2003
    Posts
    156

    Default

    Originally posted by rpmws
    actually I just verified this on 4 servers, 5 domains. I get this error when loading the index page on the osc dir.

    1046 - No Database Selected

    select configuration_key as cfgKey, configuration_value as cfgValue from configuration
    We're getting the exact same error on servers with the latest Edge release.

    On servers with WHM 7.4.2 cPanel 7.4.2-R158, no problem installing and the cart works great.

    Help!

    cPanel.net Support Ticket Number: 23425

  15. #15
    cPanel Verified Vendor This forum account has been confirmed by cPanel staff to represent a vendor.
    Join Date
    Jan 2003
    Posts
    156

    Default

    Here's the latest from Cpanel:
    Yes, this seems to be a bug, I'll forward this to the developers.

    Thank you.

    cPanel.net Support Ticket Number: 23425

Similar Threads & Tags
Similar threads

  1. Need help configuring mysql & Oscommerce
    By krobinsonmedia in forum Database Discussions
    Replies: 2
    Last Post: 07-23-2008, 11:45 AM
  2. osCommerce & php 5
    By kapOcha in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 02-16-2007, 09:04 AM
  3. OScommerce - Date & time
    By marcos88 in forum cPanel Developers
    Replies: 1
    Last Post: 01-16-2006, 03:03 AM
  4. OsCommerce & Invision - Can't install from WHM
    By jezlurkin in forum cPanel Developers
    Replies: 1
    Last Post: 04-01-2005, 01:48 PM
  5. openinstaller update script nuke & phpbb problem ?
    By RegisterHosting in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 11-12-2004, 10:30 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube