Your IP : 216.73.216.40


Current Path : /var/www/html/ajay/phpwebsite-1.8.x/setup/help/
Upload File :
Current File : /var/www/html/ajay/phpwebsite-1.8.x/setup/help/database.en_US.txt

Database Assistance
---------------------------------------------------------------------

Here are some steps to try and get your database working with
phpWebSite.

Quick note: if using PostgresSQL, please check end of document.

Step 1 - Make sure your database is running
---------------------------------------------------------------------

You should have an alternate way to access the database. For example
with mysql you enter:

# mysql -u username -p

This lets you log into the localhost installation of your mysql
database. The format may differ per database.

Can you log in? If you cannot, the database is either 1) not
installed, 2) not running.

To verify the database is installed, check your rpms, run a
search on your hard drive, etc. Just make sure it exists.

To make sure your database is running, check your active processes,
your system service list, etc. for the database.

Only once you can log in to your database (or you have been assured it
is running by the system administrator if you are hosted) should you
continue.


Step 2 - Test php's connection
---------------------------------------------------------------------

Try making this little file (using mysql as an example):

<?php
mysql_connect('localhost', 'database_user', 'database_password');
?>

Other databases have different connect commands. Check php's
documentation for more details.

The 'localhost' refers to a local database server installation. This
would be an ip or dns address otherwise. The user and password are
your database's user name and password respectively.

Point your browser at this file. If you get an error message, then php
can't connect.

If you skipped Step 1 because of a hosted environment, BE SURE that
they created a user and password for you.

If you know that the user name and password are correct but the
database is not located locally, be sure that your web server is
allowed to access the database server. Make sure your web server is in
the firewall.

(Note: If you DO NOT get an error message, the problem may be
with phpWebSite. Your database may not be supported. Enter a bug
report.)

Step 2a - Is your database compiled into php?
----------------------------------------------------------------------

Make a little file named info.php with the following:

<?php phpinfo(); ?>

Now point your browser at that file and search for your database
name (e.g. mysql, pgsql, etc.) . If you don't see it, it may not be
compiled into your copy of php. 

In this case, you will need to recompile or reinstall php with your
database's support. Make sure to restart your web service after
changing php's configuration.


Step 3 - Checking phpWebSite's connection
----------------------------------------------------------------------

If you are able to login via a terminal and you have been able to
login using a short php command then you are ready to tackle problems
in phpWebSite.

Double check the database name, user name, and password. They must be
exact to make a connection.

Make sure that the database type matches the database you wish to use.

Make sure you set the right host. Localhost is the default. This needs
to be changed if the database is on another server. Some databases
(e.g. Postgresql) leave this empty.

Double check your host port. For MySQL this is normally left blank,
however for Postgresql, the port (usually 5432) must be entered.


Step 4 - Your first database
----------------------------------------------------------------------
Once you are connecting, phpWebSite will attempt to create a
database for its tables. If you DO NOT get an attempt prompt,
you may need to create it yourself. Log in to your database and create
the database like so:

CREATE DATABASE phpwebsite;

with 'phpwebsite' being the same as the database name you are using on
the installation screen.


Final Notes:
---------------------------------------------------------------------
If you are using PostgresSQL, phpWebSite will NOT be able to create a
new database for you. You must create a database to install into
beforehand.

We recommend you invest in a web enabled database tool. We use
phpMyAdmin for MySQL and phpPgAdmin for Postgres. Both are excellent
web administration tools.

Also, if you want to create the configuration file, but for some
reason DO NOT want it to check the connection, change the
CHECK_DB_CONNECTION value to FALSE in your setup/config.php file.