
Installation of PHPShop Version 0.6

*************
QUICK INSTALL
*************

1.  Install PHP.  Test.  For help visit the PHP site at http://www.php.net.
    
    Make sure that track_vars is enabled.
    Make sure that magic_quotes_gpc is enabled.

    This is can be done by editing the php.ini file.
    For more information on how to do this, please refer to the PHP manaul.

2.  Install MySQL.  Test. For help visit the MySQL site at 
    http://www.mysql.com.

3.  Uncompress the phpshop distribution anywhere outside your web tree.  
    
    ** Security Note:
    If you cannot install outside your web tree, then for security you 
    should protect the phpshop directory using an .htaccess file restricting
    access to the phpshop directory through a web browser to authorized
    users.  Refer to the Apache manual for more information on securing 
    directories.
    **

    These examples assume you installed under "/home".  The uncompressed 
    distribution would create:

    /home/phpshop/      	<- phpShop DOCROOT - main document root
    /home/phpshop/etc           <- location of configuration files
    /home/phpshop/bin	        <- location of the main index.php3 file
    /home/phpshop/ps_image	<- location of the phpShop images
    /home/phpshop/db		<- location of database files
    /home/phpshop/modules	<- location of all modules


4.  Edit the index.php3 file.  Edit the value of $base_dir.  You must set
    this to point to the installation directory of phpshop.  Based on our
    example above:

 	$base_dir = "/home/phpshop/";

    ** NOTE:  Make sure you add the trailing "/";

5.  Next we need to edit the etc/phpshop.cfg.  This is the main configuration 
    file for the phpShop system. First off, we need to rename the 
    phpshop-dist.cfg to phpshop.cfg.  


    Then edit phpshop.cfg.  You will need to edit the following entries:
    
    "URL"                   =>      "http://www.phpshop.org/demo/",
    "SECUREURL"             =>      "http://www.phpshop.org/demo/",
    "WEBROOT"               =>      "/home/httpd/html/demo/",

    ** NOTE: If you do not have a secure server, you still must set the 
	     SECUREURL variable.  You can simply set it to be the same
	     as the URL variable.  If you have a secure server then use the 
             url to your secure sever (i.e. https://www.phpshop.org/demo/).

    You'll see a buch of other stuff, but this will get you going for now.  
    You can play with the rest later.  Beware of the beginning and ending 
    slashes on the directory names.  Also remember those commas at the end 
    of every line!

6.  Now we have to create the phpShop database.  Now at this point we have 
    to do a few things:
     
     a.  We need to create the database on MySQL.  You may
         have this already if you are hosting with someone.
         Otherwise, as root:

         mysqladmin create phpshop

     b.  We need to make sure we have a user with SELECT, INSERT
         UPDATE, DELETE, CREATE, ALTER, and DROP privelages.  If you
         are hosting with someone you probably have this already.  
         Otherwise, as root:

         $>mysql mysql

       Inside mysql type:

         >GRANT
         >    select, insert, update, create, alter, delete, drop
         >ON
         >    database.*
         >TO
         >    user@localhost
         >IDENTIFIED BY
         >    'password';
         >quit 

       where you replace the relevant information (i.e. database, user, 
       and password).

         $>mysqladmin reload

     c.  We then import the tables and data from the phpShop distribution.
         
         mysql -u <username> -p <password> -h <hostname> phpshop < \
                                        DOCROOT/db/phpshop.sql

     d.  We update the database definitions in etc/phpshop.cfg to point at 
         the database with appropriate username/password combination. 

        "DB_HOST"               =>      "<hostname>",
        "DB_NAME"               =>      "<db_name>",
        "DB_USER"               =>      "<username>",
        "DB_PWD"                =>      "<password>",
  

7.  Create the WEBROOT directory in your web server's root directory where the 
    phpShop processor will be installed.  i.e. /home/httpd/html/demo.  Then 
    copy the phpShop interpretter to the WEBROOT.

    cp /home/phpshop/bin/index.php3 /home/httpd/html/demo/.

    OR if you web server allows following symbolic links:

    ln -s /home/phpshop/bin/index.php3 /home/httpd/html/demo/index.php3

    ** NOTE: If you are using PHP4 you should rename index.php3 to 
             index.php.

8. Copy the phpShop ps_image directory to your web server's root directory.

    cp -R DOCROOT/ps_image /home/httpd/html/.

    ** NOTE:  The images are copied to the web server root, NOT the WEBROOT
              directory.  The WEBROOT directory designates the location of
              the index.php3 file.
  
9. Copy the demo store images to the WEBROOT directory.  

    cp -R DOCROOT/modules/shop/shop_image WEBROOT/.
   
   Warning! If you don't do this, you will get an "Unable to Unlink" file 
   error when you attempt to upload new images to the shop.  (The function
   tries to delete the old image before uploading a new one.)
 
10. Open your web browser and go to http://www.phpshop.org/demo.  You should
    see the demo store.  

11.  To get into the administration area, login as:

    username:  admin
    password:  test

12. In the administrative area, go the the phpShop Administrator and 
    immediately change the admin's password to something else.

    ** NOTE:  The following users are preinstalled in the phpShop distribution:

              UID	    PWD	      PERMS
	      ----------------------------------
	      test	    test      shopper
	      storeadmin    test      storeadmin
	      demo	    demo      demo
	      admin	    test      admin

13. Study the demo store. Study both the shop and the way it is set up in the 
    administrative area and you should be off to a good start!

14. Create your own store by editing Washupito's Tiendita.
 
15. Let us know if anything goes wrong.  phpShop has quite a few lines of 
    code which makes debugging a real... pleasant experience.  But we would 
    not be able to enjoy the peace and tranquility of a soothing summer 
    afternoon sitting - debugging, without your help.  Please report bugs at:
    
    http://www.sourceforge.net/bugs/?group_id=747



