Re: ibase_connect...how to specify a port?
| From: | Jochem Maas | Date: | Tue, 26 Jul 2005 19:58:27 +0000 |
| Subject: | Re: ibase_connect...how to specify a port? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-219378@lists.php.net to get a copy of this message | ||
James wrote:
How do you specify a port to connect to? I tried using localhost:3050you can't/don't specify the port in your connection string.
(3050 is the default port that Firebird) and that didn't work.yeah somebody using the firebird extension! or trying at least. ;-) you have to specify the port that firebird is bound to in the SERVICES file (its name and location differ depending on your platform) - on windows the firebird installer should do this for you. on linux you have to edit /etc/services (the format is pretty simple) also check out the aliases.conf file which lives alongside your fierbird.conf file where you can do stuff like: mydb = '/path/to/your.gdb' and then: ibase_connect ( 'mydb', $username , $password ); which is nice and allows easy to port code :-)
$host = 'localhost:/path/to/your.gdb' ;IIRC the localhost part is not required, so the following will do: $host = '/path/to/your.gdb' by all means come back with firebird questions - as far as firebird/php are concerning I am a 1 man [marketing] army :-) computed-fields, multi-db transactions, views, triggers, constraints, stored procedures, PROPER parameterized queries! it's like using Oracle without the pre-requisite second mortgage, without the the nightmare API AND (maybe most important) with the added bonus that you are not making some twat like Larry Elison even richer :-) for those of you who are strong in DBs/SQL give it a try it's great stuff!
$username = 'SYSDBA'; $password = 'masterkey';do change this :-) and/or lock down port 3050 on your firewall. rgds
$dbh = ibase_connect ( $host , $username , $password );