linux-l: PHP3 und remote db-access

Thomas Knop tknop at isv-gmbh.de
Mo Mär 22 09:44:47 CET 1999


Karlheinz Zinnhobler wrote:
> 
> Thomas Knop wrote:
> >
> > Karlheinz Zinnhobler wrote:
> > >
> > > Hallo ihr alle,
> > > weiß jemand, wie PHP3 zu konfigurieren ist, wenn die db (z. B. Mysql
> > > oder Informix) auf einem anderen Server liegt. Wie lautet ggf. die
> > > Syntax um eine bestimme db unter einem bestimmten Informix-db-server auf
> > > einer anderen Maschine mittels ifx_connect anzusprechen. Habe leider
> > > auch in den mailing lists von PHP bislang nichts brauchbares gefunden.
> > Wie wäre es mit dem PHP-Masnual und der Installationsanleitung?
> > Ist doch nun wirklich kein Problem!
> >
> > > Danke im voraus
> > > Karlheinz
> > > --
> 
> Zunächst mal vielen Dank an Matthias für den netten Zuspruch.
> Was für den einen vielleicht trivial ist, kann für den anderen ein
> unüberwindliches Problem sein. Hinweise wie: lies doch im Handbuch nach
> sind m. E wenig hilfreich. Ich bin bis dato implizit davon ausgegangen,
> daß man sich erst an eine mailing list wendet, wenn man auch nach
> Studium der entsprechenden handbücher, Internetrecherchen etc..  keine
Gnau das kann ich Dir nicht so recht glauben! Aber um deine Frage zu
mysql zubeantworten die entsprechenden Auszüge aus dem PHP3-manual:

--with-mysql=DIR
     
Enables MySQL support. The parameter to this option is the MySQL install
directory and defaults to /usr/local. This is the default installation
directory of the MySQL distribution.

: soll heißen, daß MySQL local vorhanden sein muß! Zumindest die
includes und libs.
: Es muß kein server laufen!

mysql_connect -- Open a connection to a MySQL Server

Description

int mysql_connect(string [hostname] [:port] , string [username] , string
[password] );

Returns: A positive MySQL link identifier on success, or false on error. 

mysql_connect() establishes a connection to a MySQL server. All of the
arguments are optional, and if they're
missing, defaults are assumed ('localhost', user name of the user that
owns the server process, empty password).
The hostname string can also include a port number. eg. "hostname:port" 

In case a second call is made to mysql_connect() with the same
arguments, no new link will be established, but
instead, the link identifier of the already opened link will be
returned. 

The link to the server will be closed as soon as the execution of the
script ends, unless it's closed earlier by explicitly
calling mysql_close(). 

: Da ist wohl nicht mehr zu sagen! Und das hast Du gelesen (nach meinem
Hinweis)?! 

> Antwort auf sein Problem gefunden hat.
> Also nochmals:
> mysql: bei der konfiguration muß man --with-mysql=DIR angeben. Wie
> lautet die Syntax bei einem remote server?
> informix: Im handbuch wird zwar informix genannt und man findet auch die
> entsprechenden Funktionen aber unter database support options wird
> informix explizit nicht erwähnt. Wie schreibt man also --with-???? =????

"./configure --help | grep -A1 with-inf" liefert bei mir:

  --with-informix[=DIR]   Include Informix support.  DIR is the Informix
base
                          install directory, defaults to nothing.

und dann wieder im manual:

ifx_connect -- Open Informix server connection

Description

int ifx_connect(string [database] , string [userid] , string [password]
);

Returns an connection identifier on success, or FALSE on error. 

ifx_connect() establishes a connection to an Informix server. All of the
arguments are optional, and if they're
missing, defaults are taken from values supplied in php3.ini
(ifx.default_host for the host (Informix libraries will use
$INFORMIXSERVER environment value if not defined), ifx.default_user for
user, ifx.default_password for the
password (none if not defined). 

In case a second call is made to ifx_connect() with the same arguments,
no new link will be established, but instead,
the link identifier of the already opened link will be returned. 

The link to the server will be closed as soon as the execution of the
script ends, unless it's closed earlier by explicitly
calling ifx_close(). 

See also ifx_pconnect(), and ifx_close(). 

> Unter informix kann man im Gegensatz zu Mysql auf einem Rechner mehrere
> Datenbankserver laufen lassen. Wie lautet also die Syntax um eine
> bestimmte Datenbank unter einem bestimmten informix-server auf einem
> anderen Rechner ansprechen zu können? Vielleicht ist das Problem nach
Nochmal: Besorg dir dan manual (nicht in den sourcen enthalten!) auf

  http://www.php.net

> wie vor lächerlich nur habe ich bis jetzt im Handbuch dazu nichts
> gefunden oder die entsprechenden Erklärungen nicht richtig verstanden.
> Ich bin weiter für jede konkrete Hilfe dankbar.
> Grüße
> Karlheinz



Mehr Informationen über die Mailingliste linux-l