Talk to me about anything. If you’d like to work with me, or
even if you just need a hug, I’ll get back to you shortly.

Please enter your name


Say something!

Type the characters you see in the picture below.

Captcha needed

+1  (818) 574-3596 
+44 (020) 8123-6463
+91 (0)   9864011106

osCommerceCoders.com

Affordable end to end oscommerce solutions with
Search Engine Optimization

Archive for the ‘oScommerce Issues’ Category

osCommerce has a problem when editing an existing manufacturer’s information. If a new manufacturer image is not loaded at the same time then the image that was there previously disappears. osCommerce also fails to delete a manufacturer’s image from the server when the manufacturer is deleted.

The solution to the problems is simple. Open the file admin/manufacturers.php

Find the following lines around line 41:

if ($manufacturers_image = new upload(‘manufacturers_image’, DIR_FS_CATALOG_IMAGES)) {
tep_db_query(“update ” . TABLE_MANUFACTURERS . ” set manufacturers_image = ‘” . $manufacturers_image->filename . “‘ where manufacturers_id = ‘” . (int)$manufacturers_id . “‘”);
}

Replace them with the following lines:

$manufacturers_image = new upload(‘manufacturers_image’);
$webimgtypes = array (‘bmp’, ‘jpg’, ‘jpeg’, ‘gif’, ‘png’);
$manufacturers_image->set_extensions($webimgtypes);
$manufacturers_image->set_destination(DIR_FS_CATALOG_IMAGES);
if ($manufacturers_image->parse() && $manufacturers_image->save()) {
tep_db_query(“update ” . TABLE_MANUFACTURERS . ” set manufacturers_image = ‘” . tep_db_input($manufacturers_image->filename) . “‘ where manufacturers_id = ‘” . (int)$manufacturers_id . “‘”);
}

Find the following around line 77 (line 81 if you’ve made the previous change already)

$image_location = DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG_IMAGES . $manufacturer['manufacturers_image'];

and replace it with the following:

$image_location = DIR_FS_CATALOG_IMAGES . $manufacturer['manufacturers_image'];

Save your work and you are done.
Cheers

This is a known bug in the latest osCommerce 060817 release and has to do with the modules not refreshing with udated changes in the admin.

This fix has worked for several users:
1. Open the catalog/admin/includes/functions/compatibility.php.
2. At the end of the “do_magic_quotes_gpc” routine, add the following code

reset($ar);

It will end up looking like this:

function do_magic_quotes_gpc(&$ar) {
if (!is_array($ar)) return false;
while (list($key, $value) = each($ar)) {
if (is_array($ar[$key])) {
do_magic_quotes_gpc($ar[$key]);
} else {
$ar[$key] = addslashes($value);
}
}
reset($ar);
}

3. Do the same for the compatibility.php file located in catalog/includes/functions/compatibility.php.

This means that the function is not defined in the store files or is defined by the store is not getting the file loaded.

this happens in badly customized templates of oscommerce.

quick fix is to delete the functions in the language files in english.php, german.php etc and then define the function in includes/functions/general.php so that is loads all the time irrespective of the language file selected.

If you need support in fixing it you can use the contact us form to get in touch with us.

Fatal error: Class ‘httpClient’ not found in /home/xxxxxx/public_HTML/catalog/includes/modules/shipping/ups.php on line 265
To solve this issue in ups module

Find this at line 265:

$http = new httpClient();
if ($http->Connect(‘www.ups.com’, 80)) {
$http->addHeader(‘Host’, ‘www.ups.com’);
$http->addHeader(‘User-Agent’, ‘osCommerce’);
$http->addHeader(‘Connection’, ‘Close’);

And replace with this:

if (!class_exists(‘httpClient’)) {
include(‘includes/classes/http_client.php’);
}
$http = new httpClient();
if ($http->Connect(‘www.ups.com’, 80)) {
$http->addHeader(‘Host’, ‘www.ups.com’);
$http->addHeader(‘User-Agent’, ‘osCommerce’);
$http->addHeader(‘Connection’, ‘Close’);

There has been a recent increase of attacks on osCommerce websites using old versions.

Hackers exploit a vulnerability that is usually used for uploading product pictures to the /images directory.

Php files are uploaded in the images directory and executed.

CUstomer and order details are displayed and also emailed to the hackers email address.

Sometimes traces are left by the hacker.
PHP files show up in the images directory (though sometimes they’re deleted after being run).

Gengerally, the following code iframe is added to every product_description and categories_description

We have a process to clean up the database and clean up the images directory

150 USD


Open /includes/application_top.php

if (tep_session_is_registered(‘navigation’))
{
if (PHP_VERSION < 4)
{
$broken_navigation = $navigation;
$navigation = new navigationHistory;
$navigation->unserialize($broken_navigation);
}
}
else
{
tep_session_register(‘navigation’);
$navigation = new navigationHistory;
}
$navigation->add_current_page();


Replace with

// navigation history
if (tep_session_is_registered(‘navigation’)) {
if (PHP_VERSION < 4) {
$broken_navigation = $navigation;
$navigation = new navigationHistory;
$navigation->unserialize($broken_navigation);
} else {
$navigation = new navigationHistory;
}
} else {
tep_session_register(‘navigation’);
$navigation = new navigationHistory;
}

$navigation->add_current_page();

cheers

1016 – Can’t open file

The following error message is shown when a database table is corrupt and can no longer be accessed nor read properly:

1016 – Can’t open file ‘<database table name>.MYI’ (errno: 145)

The error message will always be shown until the database table involved has been repaired.

1016 – Can’t open file Solution

The following methods are available to repair damaged database tables, depending on whether the database server is still running or not:

o Using the “repair table” SQL statement
o Using the “myisamchk” command

The <database table name> part in the commands below must be replaced with the actual database table name as shown in the error message.

Using the “repair table” SQL statement

The following SQL statement can be executed when the database server is still running:

repair table <database table name>;

Using the “myisamchk” command

The following command, which is part of the MySQL installation, can be executed on the server when the database server is no longer running:

myisamchk /path/to/database/directory/<database table name>.MYI

References

o MySQL Documentation: 15.1.4.1 Corrupted MyISAM Tables
o MySQL Documentation: 14.5.2.6 REPAIR TABLE Syntax
o MySQL Documentation: 5.6.2.1 myisamchk Invocation Syntax

1030 – Got error 127 from table handler

This indicates the table mentioned is corrupt.

1030 – Got error 127 from table handler Solution

Try running a repair and optimize on the table in phpMyAdmin.

1046 – No Database Selected

This indicates that either no database has been created or the wrong database name DB_DATABASE exists in the configure.php files.

select configuration_key as cfgKey, configuration_value as cfgValue from configuration

1046 – No Database Selected Solution

Check to make sure the database has been created and the catalog/includes/configure.php and catalog/admin/includes/configure.php files for correct database name.

Warning: mysql_connect(): Access denied for user:

The following error message is shown when either the username or password is incorrect for the database connection:

Warning: mysql_connect(): Access denied for user: ‘username@localhost’ (Using password: YES) in /home/username/public_html/shop/includes/functions/database.php on line 19
Unable to connect to database server!

Warning: mysql_connect(): Access denied for user: Solution

You will need to check with your hosting provider the username and password required to access the MySQL database and/or check the catalog/includes/configure.php and catalog/admin/includes/configure.php files for incorrect information.

Warning: mysql_connect(): Can’t connect to local MySQL server through socket

The error Can’t connect to … normally means that there is no MySQL server running on the system or that you are using an incorrect Unix socket filename or TCP/IP port number when trying to connect to the server.

Warning: mysql_connect(): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (111)
in /var/www/html/store/catalog/includes/functions/database.php on line 19
Unable to connect to database server!

Warning: mysql_connect(): Can’t connect to local MySQL server through socket Solution

The following are checks for mysql to see if it is running and setup properly.

1. Start by checking whether there is a process named mysqld running on your server host.
Use ps xa | grep mysqld on Unix or the Task Manager on Windows.

2. It might also be that the server is running, but you are trying to connect using a TCP/IP port, named pipe, or Unix socket file different from those on which the server is listening. To find out what port is used, and where the socket is, you can do:
shell> netstat -l | grep mysql

3. The grant tables must be properly set up so that the server can use them for access control.

One way to determine whether you need to initialize the grant tables is to look for a `mysql’ directory under the data directory. (The data directory normally is named `data’ or `var’ and is located under your MySQL installation directory.) Make sure that you have a file named `user.MYD’ in the `mysql’ database directory. If you do not, execute the mysql_install_db script. After running this script and starting the server, test the initial privileges by executing this command:
shell> mysql -u root test

4. Sometimes a simple restart of mysql will fix the problem.

References

o MySQL Documentation: 5.5.8 Causes of Access denied Errors
o MySQL Documentation: A.2.2 Can’t connect to [local] MySQL server

Warning: mysql_connect(): Host ‘******’ is not allowed

This indicates the wrong server DB_SERVER information in the configure.php files.

Warning: mysql_connect(): Host ‘******’ is not allowed to connect to this MySQL server in *:\******\www\*****\******\includes\functions\database.php on line 19
Unable to connect to database server!

Warning: mysql_connect(): Host ‘******’ is not allowed Solution

Check the catalog/includes/configure.php and catalog/admin/includes/configure.php files for incorrect information.

Warning: Too many connections

The following error message is shown when the maximum number of connections to the database server has been reached:

Warning: Too many connections in /path/to/osCommerce/includes/functions/database.php on line 19 Warning: MySQL Connection Failed: Too many connections in /path/to/osCommerce/includes/functions/database.php on line 19. Unable to connect to database server!

Warning: Too many connections Solution

This problem is common for shared hosting servers and requires correspondance with the server administrator.

This problem is generally not a fault of osCommerce, but can be experienced when osCommerce is installed on budget hosting servers.

This happens due to a bug in OSCommerce after the server upgrade is from PHP 4.x to PHP 5. The way the code was written in upload.php was using an undocumented feature that was not officially supported, and subsequently did not carry over into PHP 5.

To fix this, edit the ‘upload.php’ file mentioned in the error message using a text editor. Open the file and find the line (about 30 lines down) that says:

// self destruct
$this = null;

And edit it to say this:

// self destruct
// $this = null;
unset($this);

(basically comment out with // the $this = null; line and add the unset($this); line)

Your admin panel should work properly now.

This is a common issue with a working admin panel when php version upgrade to 5 is done

After upgrading a OsCommerce site to PHP5 the follow errors occurred when using the customer part of the admin section:

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /catalog/admin/customers.php on line 782

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /catalog/admin/customers.php on line 784

Warning: reset() [function.reset]: Passed variable is not an array or object in /catalog/admin/includes/classes/object_info.php on line 17

Warning: Variable passed to each() is not an array or object in /catalog/admin/includes/classes/object_info.php on line 18

To eliminate thee array_merge() errors, edit the admin/customers.php file:

Find these lines:

$customer_info = array_merge($country, $info, $reviews);

$cInfo_array = array_merge($customers, $customer_info);

and change them to:

$customer_info = array_merge((array)$country, (array)$info, (array)$reviews);

$cInfo_array = array_merge((array)$customers, (array)$customer_info);

Error Messages –

Warning: Too many connections in /path/to/osCommerce/includes/functions/database.php on line 19 Warning: MySQL Connection Failed: Too many connections in /path/to/osCommerce/includes/functions/database.php on line 19. Unable to connect to database server!

This problem is generally not a fault of osCommerce, but can be experienced when osCommerce is installed on budget hosting servers.

The following error message is shown when the maximum number of connections to the database server has been reached:

Warning: Too many connections in /path/to/osCommerce/includes/functions/database.php on line 19
Warning: MySQL Connection Failed: Too many connections in /path/to/osCommerce/includes/functions/database.php on line 19. Unable to connect to database server!

Warning: Too many connections Solution

This problem is common for shared hosting servers and requires correspondance with the server administrator.

Contact Us
Name*
Email*
Phone*
Services*
Message*
Security Code* 2459f
 
 

REACH US



You can email us at oscommercecoders@gmail.com


or Click here to contact us or call us at +1 - 818-574-3596

TAG CLOUD

Sponsors