These instructions apply to PHPLIB running with CGI PHP. Most of them is valid for mod_php as well, though. This section offers an incremental approach to find installation problems, should the above installation process fail.
We do have a support mailing list available under the address phplib-users@lists.sourceforge.net. To subscribe to the list, send a message with subscribe as the subject to the address phplib-users-reguests@lists.sourceforge.net.
Make sure your web server is up and serving the virtual host you just set up. To do this, construct a small file test1.html in your DocumentRoot and access test1.html through your web server.
Make sure your web server is up and does run CGI. Check the current directory, the UID/GID it is running programs under and have a look at the environment variables. Install the following shell script (for most cases cutting and pasting)
#! /bin/sh -- echo "Content-Type: text/plain" echo id echo pwd echo env | sort echo
What UID/GID are you running under, what is the output of pwd and what environment variables are set? What does QUERY_STRING look like? What does the PATH variable look like, what does the LD_LIBRARY_PATH variable look like and are all libraries needed by PHP accessible to PHP running in the CGI environment (Check by running the Unix ldd command on PHP).
In particular, if you built Oracle support into PHP and linked libclntsh dynamically: Can it be loaded from the CGI environment? If not, PHP will not come up later in the next step.
Copy your PHP binary into the cgi binary directory (which should NOT be below DocumentRoot!) and make it executable. Copy php3.ini or php.ini into the same directory. In DocumentRoot, create a test2.php3 and put <?php phpinfo() ?> into it.
Are you running Apache? Add
Action php3-script /cgi/php
AddHandler php3-script .php3 .php
DirectoryIndex index.php3 index.php index.html index.htm
FancyIndexing onOpen test2.php3 in your browser and see that it is being executed. Make changes to your php.ini(preferable some color definitions) and reload. Are they reflected in the output of phpinfo()? If not, your php.ini is not being found and your are having a problem. Recompile with proper settings.
Check the output of phpinfo() carefully! Is your PHP version current? Are your database interfaces present in the output of phpinfo()? If not, recompile again.
Can you access test2.php3 under the URL /cgi/php/test2.php3 as well? If so, you did not compile your PHP interpreter with --enable-force-cgi-redirect. PHPLIB will not work with this interpreter. Recompile with the switch being set.
Assuming your server is already correctly setup (don't forget to activate the PHP lines in httpd.conf!), enter the following file and save it as test2.php3 under your DocumentRoot.
<? phpinfo() ?>
Does you PHP include PHPLIB properly? Check your php.ini file. It must include the following settings:
include_path = pathname to directory with all the .inc files
auto_prepend_file = path to prepend.php3
track_vars = On
<?php
$db = new DB_Example;
print "It works without error messages.<br>\n";
?>PHPLIB installation requires that you adapt local.inc properly. Particularly, the provided class DB_Example must be customized for your database connection. Test that your web server can access the database with the following page:
<?php
include("table.inc"); // requires include_path to be functioning
$db = new DB_Example;
$db->query("select * from auth_user");
$t = new Table;
$t->heading = "on";
$t->show_result($db);
?>Access the page index.php3 that has been provided with the distribution. This page will try to set a cookie in your browser. Allow that cookie to be set.
The page will display a headline with a counter. Reload that page. The counter must increment. If not, either your browser cannot deal properly with cookies or PHPlib cannot properly read or write the table active_sessions in your database. Check that the cookie is being set by viewing the output of phpinfo(). Check your database permissions with your database command line interface.
Try loading showoff.php3 that has been provided with the distribution. This page will require a login. Login as kris, using a password of test. If the login is successful, you will see the per-session counter and a per-user counter again. Reload that page: The counters must increment.
If you can't login, you probably have a problem with cookies. Check again that your browser accepts and sends session cookies. Another problem may be access to the auth_user table. You must be able to SELECT on that table and there must be at an entry for the user you are trying to login.