First, make sure Apache and Sybase are started:
# /usr/local/apache/bin/apachectl start # /opt/sybase/install/rc.sybase start |
Now go to the directory /usr/local/apache/htdocs. Create a file called test.php and insert the following contents:
<?php $con = sybase_connect("SYBASE", "sa", ""); sybase_select_db("pubs2"); $qry = sybase_query("select * from titles", $con); echo sybase_result($qry, 1, 1); sybase_close($con); ?> |
Save the file and then access the following URL in your browser:
http://localhost/test.php |
If you see some text, then congratulations! You have a complete Linux/Apache/PHP/Sybase-ASE installation. If not...well, there you go. Make sure you actually have installed the pubs2 database. If you are not sure, try running:
# isql -Usa -P < /opt/sybase/scripts/installpubs2 |
if you have any problems, corrections (please!) or additions, but please do not email me unless you have tried everything in this howto! Thanks.