<HTML ><HEAD ><TITLE >Configure Environment</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.63 "><LINK REL="HOME" TITLE="Sybase-PHP-Apache mini-HOWTO" HREF="index.html"><LINK REL="PREVIOUS" TITLE="Install Sybase" HREF="instsybase.html"><LINK REL="NEXT" TITLE="Install PHP" HREF="instphp.html"></HEAD ><BODY CLASS="SECT1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Sybase-PHP-Apache mini-HOWTO</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="instsybase.html" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="instphp.html" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="SECT1" ><H1 CLASS="SECT1" ><A NAME="CONFIG" >4. Configure Environment</A ></H1 ><P >After installing Sybase, you need to setup the Linux environment in order to allow clients to connect to the dataserver.</P ><P >The first thing we need to do is to set certain environment variables in <TT CLASS="FILENAME" >/etc/profile</TT >. Open <TT CLASS="FILENAME" >/etc/profile</TT > as super user and insert the following lines:</P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><FONT COLOR="#000000" ><PRE CLASS="PROGRAMLISTING" > export SYBASE=/opt/sybase export SYBPLATFORM=linux export LD_LIBRARY_PATH=$SYBASE/lib export LC_ALL=default export PATH="$SYBASE/bin:$PATH" export DSQUERY=SYBASE</PRE ></FONT ></TD ></TR ></TABLE ><P >Next you need to change to permissions of the Sybase directory. This fixes some problems where PHP is unable to connect to the Sybase server. Run the following command as super user:</P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><FONT COLOR="#000000" ><PRE CLASS="PROGRAMLISTING" >chown -R sybase:sybase /opt/sybase</PRE ></FONT ></TD ></TR ></TABLE ><P >To test whether your Sybase environment works, type the following:</P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><FONT COLOR="#000000" ><PRE CLASS="PROGRAMLISTING" > # su - nobody $ isql -Usa -P 1> sp_helpdb 2> go</PRE ></FONT ></TD ></TR ></TABLE ><P >You should see a list of databases. To test whether you can use the sample datebase, now type:</P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><FONT COLOR="#000000" ><PRE CLASS="PROGRAMLISTING" > 1> use pubs2 2> go 1> select * from titles 2> go</PRE ></FONT ></TD ></TR ></TABLE ><P >If you a list, you have sucessfully set up Sybase.</P ><DIV CLASS="NOTE" ><BLOCKQUOTE CLASS="NOTE" ><P ><B >NOTE: </B >You may need to do the following in order for PHP to be able to access Sybase. Edit the file /opt/sybase/install/rc.sybase and remove the line that says:</P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><FONT COLOR="#000000" ><PRE CLASS="PROGRAMLISTING" > unset LANG; unset LC_ALL; \ </PRE ></FONT ></TD ></TR ></TABLE ><P >I don't know why that line is there, but it can stuff things up.</P ></BLOCKQUOTE ></DIV ><DIV CLASS="NOTE" ><BLOCKQUOTE CLASS="NOTE" ><P ><B >NOTE: </B >Some people have reported problems with the way the Sybase init scripts try to guess the Sybase directory. If you see the following error:</P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><FONT COLOR="#000000" ><PRE CLASS="PROGRAMLISTING" > errorerwerqwerqwerwerwer <P >when trying to run sybinstall.sh or rc.sybase, then you need to change</P ></PRE ></FONT ></TD ></TR ></TABLE ></BLOCKQUOTE ></DIV ><P >You may also want to add sybase to the list of services to run at boot time. To do this execute the following commands:</P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><FONT COLOR="#000000" ><PRE CLASS="PROGRAMLISTING" > # ln -s /opt/sybase/install/rc.sybase /etc/rc.d/init.d/sybase # ln -s /etc/rc.d/init.d/sybase /etc/rc.d/rc3.d/S15sybase # ln -s /etc/rc.d/init.d/sybase /etc/rc.d/rc3.d/K15sybase</PRE ></FONT ></TD ></TR ></TABLE ><P >Now Sybase will start whenever you boot into runlevel 3.</P ><DIV CLASS="NOTE" ><BLOCKQUOTE CLASS="NOTE" ><P ><B >NOTE: </B >The note for </P ></BLOCKQUOTE ></DIV ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="PREAPACHE" >4.1. Preconfigure Apache</A ></H2 ><P >Download and unpack the latest Apache distribution. In the Apache directory issue the following command:</P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><FONT COLOR="#000000" ><PRE CLASS="PROGRAMLISTING" > # ./configure --prefix=/usr/local/apache</PRE ></FONT ></TD ></TR ></TABLE ><P >I think the 'prefix' value specifies where you want to store your html files; I just set it to the same as the apache install directory, where Apache will put its files when you run '<B CLASS="COMMAND" >make install</B >'.</P ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="instsybase.html" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="instphp.html" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Install Sybase</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" > </TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Install PHP</TD ></TR ></TABLE ></DIV ></BODY ></HTML >