PHP on windows

Advert test
#1
I have been all day at this and still can not get it to work.

I am looking into php coding, but i can not get to display pages on localhost. I got the php 5 installed, looked into the php.ini file, made changes, but hell no doesn't get it yet.

I have the dreamweaver MX and can not make connection to the database, something about "mysql_pconnect".

I'll give it another go tomorrow, but i was hopping in getting some light from some of you.
 

mneylon

Administrator
Staff member
#2
Could you give more information on your development environment?

If you are just starting out with PHP I'd recommend you try one of the install kits you can get off Hotscripts. Most of them will give you Apache + PHP and maybe Perl and TCL

You may end up deploying on a windows environment, but you may find it easier to get to grips with the language if you start on apache
 
#3
I was trying to get it to work with windows IIS, but now i am about to install Apache server, then reinstall php 5 again see how it works out.
 
#7
http://www.easyphp.org/ is a very simple all in one setup for php / apache / mysql.

runs fine on windows. I have mine on windows server 2000 - works fine.


I definatly wouldn't run php on an IIS local server - been there - don't work.

I would also stick to php4 unless you are particuarly interested in working with php5

I would question why you are using mysql_pconnect , in my experience stick with mysql_connect. I have experienced problems myself of an accumaliting number of mysql processes which has been down to people using pconnect. In fact I would now configure php.ini with allow_persistent = Off unless there was some good reason not too.

Another tip - try to have your local server configured as closely as possible to your deployment server.
 
#11
i hadn't realised you're an ASP head ... you'll have no problem at all.

I programmed ASP 2 years for some firm in Germany .. absolutly no looking back after the switch to php.

enjoy.
 
#12
ph3n0m said:
mysql_pconnect - opens a persistent connection - as far as I know the default install from apachetriad doesnt allow persistant connections

http://www.google.ie/search?hl=en&q=connect+to+mysql+database&btnG=Google+Search&meta=

Try the first few links
from my reading the _pconnect is persistent which means won't close with the statement mysql_close() when the _connect will which I think you better off using and make sure you are making a habbit in closing the connection when no nedeed anymore.

cool
 
#13
9barJoe said:
i hadn't realised you're an ASP head ... you'll have no problem at all.

I programmed ASP 2 years for some firm in Germany .. absolutly no looking back after the switch to php.

enjoy.
Indeed i use ASP in the last 4 years. was going to switch to asp.net, but as well as that want to learn c++ which is kind of using the same language as php (more advance), and the other day i got this program that i am running on a website that is done in php, and i didn't feel right that i couldn't understand it properly, like what the code does, when and why, so i said it's time to get back to "school" and get on with it.

Thanks guys, you are a great help.
 
#14
aye, pconnect() opens a persistant connection, which I have not myself found the need for as to date.

Just stick with connect()

If you use connect() , you do not have to explicitly close the connection at the end of a script, but I believe it is good practice.

If you a making a site with an include for the footer, if you know what I mean .. or just some include that always comes at the end of each page .. just drop in something like this

if ($db_link) {@mysql_close($db_link);}

that will cover yer as
 
#17
the manual is better than any book. There are plenty of user comments & examples in the function reference section.

I would however recomend Mysql by paul DuBois ISBN 0-7357-1212-3, that's a good book, or beiginning databases with mysql published by Wrox is a bit simpler.

The best tip you can get is this --- find your php.ini on your local server (in apache directory normaly) & set error_reporting = E_ALL

This will force you to programme nice & clean - get used to that from day 1 & it will benefit you in the future.
 
#18
checked the php.ini and the error reporting is already setup as:

error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT

I guess that should do it.

Also I was looking at the Wrox "Beginning PHP4" , i always found them very good.
 
#20
blacknight said:
So how are you getting on?
I am actually getting somewhere. Tottaly different then what I was expecting, but slowly and surely i am working my way up the knowledge ladder.

i managed to make connection to the database, pull out records, create "define" global (called "Applications" in asp i think..), stiil looking for short cuts to typing code (the use of functions which are similar to asp, but can not find anything to replace the asp "sub .. end sub" as yet.)

Thanks for asking.
 
Top