This is a dedicated thread for discussing the SitePoint article 'Use PostgreSQL and PHP on Windows'
Printable View
This is a dedicated thread for discussing the SitePoint article 'Use PostgreSQL and PHP on Windows'
After looking at various other tutorials for getting PostgreSQL working under Win98SE I thought "Not another tutorial huh ?"
Anyways, views aside I read on and thinking that this tutorial was a bit more indepth that the others I read, I reinstalled cygwin again [4th time] and continued...
Well, here is what I got once I clicked on the setup.exe file :(
Explicits have been removed so not to cause offence :D
Quote:
"Copying skeleton files.
These files are for the user to personalise
their cygwin experience.
These will never be overwritten.
`./.bash_profile' -> `/home/Docter//.bash_profile'
`./.bashrc' -> `/home/Docter//.bashrc'
`./.inputrc' -> `/home/Docter//.inputrc'
$ ipc-daemon2 --install-as-service
$ net user developer groovy /add
The command USER is unknown. For a list of valid commands, type NET HELP at
the command prompt.
For help, type NET /? at the command prompt.
$"
Umm... Doesn't look too good does it ? Maybe someone who follows through with this tutorial and has some thoughts on the matter ?
Ideas and solutions are most welcome folks :)
Apart from that though, good article btw; more indepth that a lot of other's I've read recently :)
Get pgsql working on Win9x/ME?
I guess it's quite impossible to use the NT services installation procedure on Wintendo95 & Co ;)Quote:
Originally Posted by postgresql-7.3.4.README
Jofa -
All Okay upto this point...
This part I can understand ? The variable required, ie PGDATA [and it's sister variables] all belong to WinNT/Pro2000Quote:
$ postmaster -D /usr/share/postgresql/data
postmaster does not find the database system.
Expected to find it in the PGDATA directory "/usr/share/postgresql/data",
but unable to open file "/usr/share/postgresql/data/global/pg_control": No such
file or directory
(Which I've had PostgreSQL running under that OS for a while - before my machine crashed and I reinstalled Win98SE;
Unable in re-install Win2000Pro as I forgot to format that partition; ie D:
Would need to format C: and repeat again which I'm not prepared to do)
Anyways, Win98SE doesn't have this variable thus I got the above error message;
Any ideas on this though ? The first steps have got me further than what the said article stipulates :D
Thanks btw.
--EDIT--
Umm.... Still looking :)Quote:
$ ipc-daemon2 &
[1] 573193
$ initdb -D /usr/share/postgresql/data
The files belonging to this database system will be owned by user "Docter".
This user must also own the server process.
The database cluster will be initialized with locale C.
initdb: The directory /usr/share/postgresql/data exists but is not empty.
If you want to create a new database system, either remove or empty
the directory /usr/share/postgresql/data or run initdb with
an argument other than /usr/share/postgresql/data.
[1]+ Done ipc-daemon2
$ postmaster -D /usr/share/postgresql/data &
[1] 461553
$ postmaster does not find the database system.
Expected to find it in the PGDATA directory "/usr/share/postgresql/data",
but unable to open file "/usr/share/postgresql/data/global/pg_control": No such
file or directory
Finally ?
I'm good to go yes ? :cool:Quote:
Fixing permissions on existing directory /usr/share/postgresql/data.
creating directory /usr/share/postgresql/data/base... ok
creating directory /usr/share/postgresql/data/global... ok
creating directory /usr/share/postgresql/data/pg_xlog... ok
creating directory /usr/share/postgresql/data/pg_clog... ok
creating template1 database in /usr/share/postgresql/data/base/1...
creating configuration files... ok
initializing pg_shadow... ok
enabling unlimited row size for system tables... ok
initializing pg_depend... ok
creating system views... ok
loading pg_description... ok
creating conversions... ok
setting privileges on built-in objects... ok
vacuuming database template1... ok
copying template1 to template0... ok
Success. You can now start the database server using:
/usr/bin/postmaster -D /usr/share/postgresql/data
or
/usr/bin/pg_ctl -D /usr/share/postgresql/data -l logfile start
[2]+ Exit 1 postmaster -D /usr/share/postgresql/data
$ psql template1
Welcome to psql 7.3.4, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
template1=#
Quote:
Start your newly-installed Cygwin Bash Shell and complete these steps:
Install ipc-daemon2 as an NT service
As you remember from the Cygwin installation, Cygipc is the interprocess communication daemon that PostgreSQL depends on.
ipc-daemon2 --install-as-service
bash: /etc/profile: Permission denied
bash-2.05b$ ipc-daemon2 --install-as-service
bash: ipc-daemon2: command not found
bash-2.05b$
Is what i get. Anyone care to offer their greatly appreciated wisdom?
The PostgreSQL Global Development group has pushed back native windows support until 7.5, due out sometime in 2004. For more information about current windows options, check out: http://techdocs.postgresql.org/guides/Windows
If you would like to help with PostgreSQL win32 development, there is a status page available at:
http://candle.pha.pa.us/main/writings/pgsql/win32.html
My guess: Insufficient permissions? ;)Quote:
Originally Posted by Sn2
Postgres installs fine on windows without cygwin, why go to the extra trouble?
Not sure though from what I remember of what documentation I'd read (PeerDirect) you need to be the owner yes ?
In Win2000 for example, this'd be the Administrator, though sorry I'm not sure of Win98SE though;
On my version whenever I now initialise a database I get a message saying that the user *myself* owns the database etc ?
Not sure myself, since I've only just begun to use Postgre myself ;)
Sorry, I'd really like to help since I've had a lot of problems installing this database myself but I don't know enough yet :(
I'm logged on as an administrator...Quote:
Originally Posted by jofa
Likewise :) Though I have found that by default when using this
This it's self doesn't include networking so you are unable to connect to TCP/IP ? You have to use this instead...PHP Code:$ postmaster -D /usr/share/postgresql/data &
Hope this'll help someone, now if only I knew how to create a user with a password ? ...PHP Code:$ /usr/bin/pg_ctl -D /usr/share/postgresql/data -l logfile -o -i start
PeerDirect on Win2000Pro which I've had running, there is another project which branches off from PostgreSQL which I can't remember ?Quote:
Postgres installs fine on windows without cygwin
Doesn't matter since continued development has been halted :( On Win98SE you do need cygwin though ?
More details please. :)Quote:
Originally Posted by Anonymous
Installs fine on Windows == can be compiled natively under Windows?
I don't think that's the best option for everyone.
PostgreSQL by dbExperts ← US$235.00
PowerGres by Software Research Associatess ← beta
UltraSQL by PeerDirect ← beta
Not sure what Anonymous means with "installs fine on windows" :confused:
> Postgres installs fine on windows without cygwin,
> why go to the extra trouble?
I want to be part of the chorus me too,
so more details would be appreciated!
:)
I attempted to install this very thing on another machine Win98SE on Monday and no cheese folks; Win98SE does not have the environment variables you need,Quote:
Originally Posted by jofa
ie PGDATA for example ?
You find these with WinNT and Win2000Pro though ;) I'm a bit lost as well as to that statement myself :confused:
Anyone tried this: O'Reilly: PostgreSQL on Windows without that cygwin business
Bet that's what "Anonymous" is talking about.
It's on my list of things to try. :-)
Quote:
Originally Posted by samsm
Quote:
Originally Posted by jofa
...seems to be working well...Quote:
Originally Posted by www.oreillynet.com
Native Windows support in v 7.4? No...
PostgreSql is indeed a very powerfull database, but they have to implement a native Windows version. The Windows version is still and still delayed. I moved to Firebird database, but I found PostgreSql very actractive.
This is a pretty good tutorial, insofar as it got PostgreSQL up and running under XP for me. However, it took a little research and tweaking to get initdb to run.
First, making the directory /usr/share/postgresql/data in Cygwin was a BAD IDEA. It resulted in all sorts of nasty permissions errors (couldn't create any files). Creating it in Windows took care of that.
Second, initdb was still having permissions issues when setting up pg_shadow (whatever that is). A little research revealed that the following commands take care of this problem:
chown 544 /usr/bin
chmod 755 /usr/bin
chmod +x+r+w /usr/bin/postgres.exe
Hope this helps someone
pgAdmin III (http://www.pgadmin.org) does not require any ODBC driver to connect to PostgreSQL. It is a fully multi-platform application available under Win32, GNU/Linux and FreeBSD.
No, the ODBC driver is needed if you "...use MS Access ... as a front-end for PostgreSQL..." ;)Quote:
Originally Posted by Anonymous
From http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=utf-8&selm=8806a44b.0401270751.214995a1%40posting.google.com
You need to install the Cygwin
encrypt/decrypt library. Run the Cygwin setup.exe, in "Selected
Packages" choose
Libs -> "crypt: Encryption / Decryption utility and library", complete
the setup. Now you should have the cygcrypt-0.dll on your cygwin/bin
folder and you should be able to run postgresql.
net start postmaster
gives this error message:
System error 2069 has occurred. The service did not start due to a logon failure. I followed the tutorial step by step, and was able to login under windows as postgres/postgres, yet the postmaster service did/will not start. As a result, pgsql will not start either...
any help? (i've tried to run net start postmaster as both postgres, and normal admin user, as logged in by windows, neither work)
-john
Hey, this is John again...
I fixed that error, my problem was that somehow the user 'postgres' didn't have rights ?, whatever...
but I fixed that, by going into services... right clicked postmaster, properties... Logon tab... and put in the password again... it prompted me that he didn't have rights, should they be given, answer yes...
BUT.. now I have a different problem...
I get this error when I run `net start postmaster` (OR start from the services window):
Could not start the postmaster service on Local Computer. Error 1067: The process terminated unexpectedly
When I do this from command line, I get this:
$ net start postmaster
The postmaster service is starting.
The postmaster service could not be started.
A system error has occurred.
System error 1067 has occurred.
The process terminated unexpectedly.
---
ultimately the same error, but perhaps more clues. I've done the standard 'restarting windows fixes all problems' a few times now, no such luck. Anyone else with any clues?
Thanks
-John
John again,
Got it working! I found the /var/logs/postmaster error log, checked it out, that pg_control didn't exist.
So I figured that if it didn't exist, that was a problem..
tried running `initdb -D /usr/share/postgresql/data` again, told me to clean out the data dir... so I did.. ran it, it worked.. and now
...
PostgreSql works!
-John
hope my mistakes helped someone else