Category Archives: PHP

Everything PHP

Moving a Zen Cart Installation

Here’s how I moved my Zen Cart installation to a sub directory.

1.) Create a sub directory on your site via: FTP or however you know to.

2.) Move all files of your Zen-Cart installation into your sub directory.

3.) Edit 2 configuration files of your zen-cart.

  • /includes/configure.php
  • /admin/includes/configure.php

In /includes/configure.php you want to edit:

  • DIR_WS_CATALOG
  • DIR_WS_HTTPS_CATALOG
  • DIR_FS_CATALOG
  • DIR_FS_SQL_CACHE

In /admin/includes/configure.php you want to edit:

  • DIR_WS_ADMIN
  • DIR_WS_CATALOG
  • DIR_WS_HTTPS_ADMIN
  • DIR_WS_HTTPS_CATALOG
  • DIR_FS_ADMIN
  • DIR_FS_CATALOG

In both of these files you simply want to add your <subdirectory> followed by a forward slash /

NOTE: All directories should not have a leading slash / and SHOULD ALL have a trailing /
example:

define(‘HTTP_SERVER’, ‘http://192.168.1.1/’);

define(‘HTTP_SERVER’, ‘http://www.example.com/’);

define(‘DIR_WS_ADMIN’, ‘shopping-cart/admin/’);

4.) Now you need to access your database via: phpMyAdmin or NaviCat

In your Zen Cart database you want to edit the configuration table in the following fields:

  • Log Destination – STORE_PAGE_PARSE_TIME_LOG
  • Session Directory – SESSION_WRITE_DIRECTORY

Use the following utility if you don’t know how to do step4:

http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=82

This worked great for me.
Please comment here if you try this or have any questions.
Thank you.

Related Posts

Upgrading PHP 5.1.2 to PHP 5.2 on Cent OS

Having problems installing PHP 5.2 on Cent OS, I could only get yum to update PHP to 5.1.2.  This was not acceptable considering I’m installing Magento on the server. I need at least PHP 5.2 to have Magento run properly, or as close as Magento gets to proper.

I got the following code from this Web Developer: http://www.christianmontoya.com/2008/10/01/upgrading-php-and-installing-apc-on-centos-5-with-plesk/
Run the following 2 lines to upgrade PHP to version 5.2

//beconfused » Blog Archive » How to solve ‘You do not have sufficient permissions to access this page.’ in WordPress

Posted from Diigo. The rest of my favorite links are here.

Zen Cart Product Database Diagram

I Remade this diagram so i can read it on an 8×11 printer. 🙂 Enjoy

Zen Cart Product Database Diagram
Diagram of Product flow in the ZenCart Database

Magento Dataflow Charting

Making basic actions in the admin interface of magento here’s 5 queries that are executed, just 5 of more than 50 queries.
Basic Magento Database Pull

PHP Error Reporting NO ERRORS ARE SHOWING UP!

So I had this problem with php not giving me any errors.  I went through my php.ini file looking for what other people posted to change.

I tried this in my php.ini

and added this to my php script:

Still i run my php and nothing came up.  Finally I found this in the php.ini

Track errors was off, now that it’s on  I see and can debug my php scrpits.

Please comment if this helps anyone.

Magento – Adding Image Rollerover Effects to Product Lists

What I’m trying to accomlish is adding a roller over effect to the images.  I want the image to pop up in another layer on rollover.

As always, with any editing of any files that currently already work, make a BACKUP!

I like to copy and paste the file, then rename it .backup

First I add the code to the css file:

Then I want to edit my template file:

Find the line (about line 100-105) that contains:

add the php signs around that and comment it out, then add my following lines:

The image resize function all depends on how you have manento setup and the cache, but this should work.  Feel free leave comments on how this works.