Results 1 to 36 of 36

Thread: run php ?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448

    run php ?

    is there anythign i need to run a php web server?

  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    Five things

    A computer (clearly you have one of these already)
    An OS (ditto)
    A connection to the internet (ditto again)
    A web server (Try www.apache.org)
    PHP binaries (Get from www.php.net)

    Install Apache, install PHP, follow configuration instructions to get them to work together. Run Apache, it should say "running PHP 4.1?".

    15 minute job

  3. #3
    You'll probably want to install mySQL at some time too (a db engine: a lot of boards and other scripts use it). http://www.mysql.com/, but beware it's a living hell to install for the first time.

  4. #4
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    Originally posted by filburt1
    but beware it's a living hell to install for the first time.
    ??

    under windows it's a piece of cake. Just use the winmysqladmin utilty (mysql root/bin) to create a my.cnf, and run the same again.

  5. #5
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    mysql was the easiest thing for me to install

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  6. #6
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    Originally posted by chrisjk
    ??

    under windows it's a piece of cake. Just use the winmysqladmin utilty (mysql root/bin) to create a my.cnf, and run the same again.
    took me 5 minutes to install mysql
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    thanks, is there anything i need to know. like how to get to my page?

  8. #8
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    when Apache installation asks for domainname, type 127.0.0.1

    Then when you want to view php pages, open IE and type 127.0.0.1. You will get a dir listing on the stuff in apache root/htdocs

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    how could i make my own domainname?

  10. #10
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    if you want it accessible to people from outside like a normal webserver, you'll have to register a domain name in the usual manner and type it in the box asking for it.

    The 127.0.0.1 is for localhost testing

  11. #11
    Well thanks for making me feel bad , because I didn't want to install it to the default directory it made things really hard, so I just gave up and installed it to c:\mysql. Then I hunted around for half an hour until I was able to find out how to install it as a service, then everything was fine and dandy.

  12. #12
    Originally posted by chrisjk
    if you want it accessible to people from outside like a normal webserver, you'll have to register a domain name in the usual manner and type it in the box asking for it.

    The 127.0.0.1 is for localhost testing
    You can fake it using http://www.dns2go.com/ . For example turtletips.dns2go.com always resolves to my computer's IP. I have it set to send a heartbeat every 20 minutes, so if my IP changes due to DHCP, turtletips.dns2go.com will point to the new one.

    Or you can spend $8.95 at http://www.godaddy.com/ and get your own real domain name.

  13. #13

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    im haveing problems installing the apache thing i really need help on that now

  14. #14

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    i dont know what command line its talking about

  15. #15
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    Originally posted by filburt1
    Well thanks for making me feel bad , because I didn't want to install it to the default directory it made things really hard, so I just gave up and installed it to c:\mysql. Then I hunted around for half an hour until I was able to find out how to install it as a service, then everything was fine and dandy.
    i didnt install it in c:\mysql and still took me 5 min

    command line meaning the dos box that comes up. what are you trying to do?
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  16. #16
    scoutt
    Guest

  17. #17

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    is it saying command prompt? if it is i tryed that it didnt work. it said it didnt know that command im trying to install the apache thing

  18. #18
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    You seem to have got lost a bit methinks.

    What have you done so far?

  19. #19

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    i extracted all the apache files and i edited to conf file (kinda) but i dont know what to do after that mabey i did it wrong to begin with

  20. #20
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    did you put this in httpd.conf?
    LoadModule php4_module G:/php/sapi/php4apache.dll
    #AddModule mod_php4.c
    AddType application/x-httpd-php .php .php3
    after following the instructions for PHP (i.e. installing it and copying the relevant files to the correct places)

  21. #21
    Also make sure you restart the Apache service...in a DOS console type:
    Code:
    net stop apache
    net start apache
    You might also want to just type (in the Apache dir)
    Code:
    apache
    And it will tell you if any of the conf files have errors.

  22. #22
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    the easiest thing to do is forget consoles completely and have a shortcut pointing to apache.exe. You can then just minimise it

  23. #23
    Originally posted by chrisjk
    the easiest thing to do is forget consoles completely and have a shortcut pointing to apache.exe. You can then just minimise it
    Ah, but then it won't run for all users on NT-based OSes

  24. #24
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    ?

    like windows 2000, like i have you mean

  25. #25

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    i have xp but it didnt come wiht an exe for the http thing thats what im working on so that i can get to the php part

  26. #26
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    did you get the source of binary distribution; because you definately want the Win32 binary distro.

  27. #27

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    where would it be ill look, do you have any instant message program that would probly be a lot easyer than posting

  28. #28
    scoutt
    Guest
    Originally posted by filburt1


    Ah, but then it won't run for all users on NT-based OSes
    why would you want it to run for anybody else as it will be a test machine anyway.

  29. #29

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    i thought i had to have that.... i didnt know i just wanted to make it for my house. it would be a php MySQL thing can you tell me what i need then?

  30. #30

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    ok i got it installed but now i have no idea where the index files are that make my page

  31. #31

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    ok everything is installed but when i try to load a php file it shows it as text not as the web style

  32. #32
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    are you using IE and have you told apache to interpret all php extensions as a php file, like this
    Code:
    LoadModule php4_module G:/php/sapi/php4apache.dll 
    #AddModule mod_php4.c 
    AddType application/x-httpd-php .php .php3
    in httpd.conf

  33. #33

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    does it matter where i put it, because i just put it in and its still not working

  34. #34
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    It shouldn't matter, i put it at the end on mine

    Did you follow these instructions
    Installing PHP on Windows with Apache 1.3.x

    There are two ways to set up PHP to work with Apache 1.3.x
    on Windows. One is to use the CGI binary (php.exe),
    the other is to use the Apache module dll. In either case
    you need to stop the Apache server, and edit your
    srm.conf or httpd.conf to configure Apache to work with PHP.

    Although there can be a few variations of configuring PHP
    under Apache, these are simple enough to be used by the
    newcomer. Please consult the Apache Docs for further
    configuration directives.

    Now that version 4.1 introduces a safer sapi module, we recommend
    that you configure PHP as a module in Apache.

    To do this, you should move php4ts.dll to the windows/system (for Windows 9x/Me)
    or winnt/system32 (for Windows NT/2000/XP) directory, overwriting any
    older file. Then you should add the following three lines to your Apache
    conf file: (swap c:/php/ for your PHP install path)

    LoadModule php4_module c:/php/sapi/php4apache.dll
    AddModule mod_php4.c
    AddType application/x-httpd-php .php

    If you wish to install PHP as a CGI binary, (the sapi is much better)
    you need to enable the apache security fix in your php.ini by
    setting cgi.force_redirect = 1. Then, insert these lines to your conf file:

    ScriptAlias /php/ "c:/php/"
    AddType application/x-httpd-php .php
    Action application/x-httpd-php "/php/php.exe"

    As a further precaution, we recommend you change the "/php/"
    ScriptAlias to something more random, to prevent any attempts to
    call your binary (like the Code Red scripts) for returning a response
    other than 404.

    Remember when you have finished to restart the server, for example,
    NET STOP APACHE
    followed by
    NET START APACHE

    To use the source code highlighting feature, add the following
    line to your apache httpd.conf file:

    AddType application/x-httpd-php-source .phps

    Note, this will only work when you install php as a sapi module.
    If you wish to use this feature with the cgi binary, create a new
    file, and use the show_source("path/to/original_file.php"); function.

    On Win-Apache all backslashes in a path statement such
    as: "c:\directory\file.ext", must be converted to
    forward slashes.

  35. #35

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    i did but its still messing up

  36. #36

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    ok i read it over again and its still lot loading php scripts right

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width