Jump to content
php.lv forumi

APACHE+PHP+PostgreSQL


feebs

Recommended Posts

postgres nav japiesaista pie apache, bet gan pie PHP. To var izdarit eneiblojot postgres moduli. Ka to izdarit ? Atkarigs no operatajsisteemas. Taka nepateici kada tev ir sikak pastastit nevaru.

Link to comment
Share on other sites

postgres nav japiesaista pie apache, bet gan pie PHP. To var izdarit eneiblojot postgres moduli. Ka to izdarit ? Atkarigs no operatajsisteemas. Taka nepateici kada tev ir sikak pastastit nevaru.

Operetajsistema ir XP prof.

Link to comment
Share on other sites

paskaties ieksh phpinfo(); ja paradas postgres modulis tad viss ir kedas.... un izmanto pg_connect f-ju lai pieslegtos datubaazei, ja izdodas pieslegties tad viss ir kedaas.

Link to comment
Share on other sites

paskaties ieksh phpinfo(); ja paradas postgres modulis tad viss ir kedas.... un izmanto pg_connect f-ju lai pieslegtos datubaazei, ja izdodas pieslegties tad viss ir kedaas.

Man uzraadaas:

pgsql

PostgreSQL Support enabled

PostgreSQL(libpq) Version 8.2.3

Multibyte character support enabled

SSL support disabled

Active Persistent Links 0

Active Links 0

 

Directive Local Value Master Value

pgsql.allow_persistent On On

pgsql.auto_reset_persistent Off Off

pgsql.ignore_notice Off Off

pgsql.log_notice Off Off

pgsql.max_links Unlimited Unlimited

pgsql.max_persistent Unlimited Unlimited

vai komandrindaa ir jaaraksta \pg_connect f-ju

lai pieslegtos?

Uzraadija:

postgres-# \pg_connect f-ju

pg_connect f-ju

pg_connect

\p: extra argument "g_connect" ignored

\p: extra argument "f-ju" ignored

Link to comment
Share on other sites

Uztaisi php skriptu:

 

 

<?php
pg_connect("host=sheep port=5432 dbname=mary user=lamb password=foo") or die(pg_last_error());
?>

 

Baaac...

Uzraadaas:

Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL server: could not translate host name "sheep" to address: Unknown host in C:\Apache2\htdocs\index.php on line 2

 

Warning: pg_last_error() [function.pg-last-error]: No PostgreSQL link opened yet in C:\Apache2\htdocs\index.php on line 2

Link to comment
Share on other sites

Nu baac! Tak ieraksti datubaazes hostu, lietotajvardu, paroli un portu taads kads attiecigi tev ir nevis kaut kadus izdomatus, kurus es tev iedevu.

To es jau biju izdarijis.. ierakstiju defaulto port=5432 dbname=postgres user=postgres

Link to comment
Share on other sites

Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL server: could not translate host name "sheep" to address: Unknown host in C:\Apache2\htdocs\index.php on line 2

 

shis errors par to neliecina :)

Link to comment
Share on other sites

ye :)

 

Vari arii paniekoties ar parejaam f-jaam, uztaisiit tabulas, ievietot datus tabulaas, izvilkt datus no tabulaam utml. Bet nu principaa viss strada :)

LIELS paldies!!!

Tagat meegjinaashu pieinstaleet phpmyadmin - ja vien tas bus iespeejams ar postgessql :)

Link to comment
Share on other sites

×
×
  • Create New...