PHP on windows

Discussion in 'Coding Help' started by louie, Feb 17, 2006.

  1. louie

    louie New Member

    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.
     
  2. mneylon

    mneylon Administrator Staff Member

    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. louie

    louie New Member

    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.
     
  4. ph3n0m

    ph3n0m New Member

  5. louie

    louie New Member

    I got that. Very nice package, but how do you create a connection to the database using dreamweaver?

    ps: i think i am over tired now
     
  6. ph3n0m

    ph3n0m New Member

  7. 9barJoe

    9barJoe New Member

    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.
     
  8. louie

    louie New Member

    got it working last night.
    Now is time for studying php.
     
  9. 9barJoe

    9barJoe New Member

    well, if you need a hand pal, fire away.
     
  10. louie

    louie New Member

    I might hold you on to that.
     
  11. 9barJoe

    9barJoe New Member

    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. louie

    louie New Member

    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. louie

    louie New Member

    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. 9barJoe

    9barJoe New Member

    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
     
  15. 9barJoe

    9barJoe New Member

  16. louie

    louie New Member

    Thanks man, I am reading it at the moment. Great manual.
    Looking also to get some books about it. Any recommendations?
     
  17. 9barJoe

    9barJoe New Member

    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. louie

    louie New Member

    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.
     
  19. mneylon

    mneylon Administrator Staff Member

    So how are you getting on?
     
  20. louie

    louie New Member

    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.
     

Share This Page