SitePoint Sponsor

User Tag List

Results 1 to 21 of 21

Thread: Localhost Help

  1. #1
    SitePoint Addict XiledWeb's Avatar
    Join Date
    May 2005
    Location
    Nashville
    Posts
    205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Localhost Help

    Hey Guys, just purchased kevin yank's database driven website book and I'm having a little difficulty. I haven't set up anything before on a localhost so - no time like the present! I could do this just via my webservers MySQL, but there's no fun in doing things the easy way...

    SQL is set up properly alongside PHP and I can confirm that apache is running (when I go to just http://localhost I get the apache confirmation message), but when I insert the script and go to http://localhost/today.php I see the code. I have the today.php file in apachegroup/apache/htdocs.

    I'm baffled.

  2. #2
    SitePoint Enthusiast shn's Avatar
    Join Date
    Jan 2006
    Location
    Munich DE
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You will have to add some lines to your httpd.conf file. These vary in which version of Apache and PHP you use and if you want to install it as a module, a cgi binary, ...

    All variations are (pretty well) explained in install.txt which comes with every php distribution in its root folder.

    If you still can't get it to work post your apache and php version, the php installation type etc. for further help, but i think you should be able to get it to work with said txt file.
    Patrick

  3. #3
    SitePoint Evangelist vhogarth's Avatar
    Join Date
    Nov 2003
    Location
    Taxachussets
    Posts
    415
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I take it you followed Kevin's book word for word in installing apachy/mysql/php? i did the same, a couple tiems. Then I found a great distribution that bundles them all and more. Its really easy to install and play with. Do a search for "apachefriends". Im telling you it will save youa bunch of time getting stuff set up. But if you really want to focus on the admin side of setting up your server, play around with it to get familiar. If you just want to get started coding, def try apachefriends.

    damn.. i sound like an advertisement, but i cant stress how simple it is. Download, install, run..

  4. #4
    SitePoint Member
    Join Date
    Feb 2006
    Location
    Sydney - Australia
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi guys,

    I was just reading this thread to gain some knowledge.

    I too am working through kevin yank's database driven website book and I haven't set up anything before on a localhost before.

    I am stuck with installing Apache (Ver 1.3.34) - I started to run the Windows installer but was confused about what to enter in the "Server Information" Dialogue box for the local host config

    - Network domain
    - Server Domain
    - Administrators Email Address

    Any help would be much appreciated. I am new to dynamic website build.

    Cheers,
    Michelle

  5. #5
    SitePoint Enthusiast shn's Avatar
    Join Date
    Jan 2006
    Location
    Munich DE
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just use 'localhost' as Domain and Server Name and the email address doesn't really matter at all if your installing the server for personal, local use only.
    Patrick

  6. #6
    SitePoint Member
    Join Date
    Feb 2006
    Location
    Sydney - Australia
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks all for your advice. I am now all up and running.

    For a beginner I am pretty proud of myself that I did not have to use a packaged install i.e apachefriends

    Now onto learning PHP scripting.

    Cheers

  7. #7
    SitePoint Addict XiledWeb's Avatar
    Join Date
    May 2005
    Location
    Nashville
    Posts
    205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by shn
    Just use 'localhost' as Domain and Server Name and the email address doesn't really matter at all if your installing the server for personal, local use only.
    I think that's my problem right there. Will look into it and post back with details.

  8. #8
    SitePoint Evangelist vhogarth's Avatar
    Join Date
    Nov 2003
    Location
    Taxachussets
    Posts
    415
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by msteg
    Thanks all for your advice. I am now all up and running.

    For a beginner I am pretty proud of myself that I did not have to use a packaged install i.e apachefriends

    Now onto learning PHP scripting.

    Cheers
    congrats on getting it working. i got it up and running from teh directions and tweaking the necessary files. But once you've done it once, its a pain if you want to reinstall to do it again, or if you want to setup another server real quick. Thats why I went with apachefriends.

    its not just about setting it up, they bundle a bunch of libraries that come in handy. It comes with php 4.2+ and 5, and allows you to switch back and forth seemlessly. Also comes with phpmyadmin to administer your db, but since your first starting out get to know the SQL syntax (i did and it helps alot), but once youv'e got a good feel of it and want an easy GUI way to administer your DB phpmyadmin is very easy to use.

    Either way, check it out see what its about it may come in handy down the line.

  9. #9
    SitePoint Addict XiledWeb's Avatar
    Join Date
    May 2005
    Location
    Nashville
    Posts
    205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, changing the domain and server to localhost didn't do it for me. I still get the apache successful installation message at http://localhost/ but whenever I run a php script, it balks just showing it as code.

    I'm running Apache 2.0.55 and I added the three lines at the bottom of the config which are:

    #LoadModule php5_module c:/php/php5apache2.dll
    #AddType application/x-httpd-php .php
    #AddType application/x-httpd-php-source .phps

  10. #10
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You shouldn't have the # in front of them, that makes it a comment in the config file.
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  11. #11
    SitePoint Addict XiledWeb's Avatar
    Join Date
    May 2005
    Location
    Nashville
    Posts
    205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [error] (OS2) The system cannot find the file specified. :No installed service named Apache2.
    But I know it's installed - I'm seeing all the files where they should be.

  12. #12
    SitePoint Enthusiast shn's Avatar
    Join Date
    Jan 2006
    Location
    Munich DE
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by XiledWeb
    I'm running Apache 2.0.55 and I added the three lines at the bottom of the config
    You shouldn't put them at the bottom of the config but to their appropriate section.

    put
    Code:
    LoadModule php5_module "c:/sv/php5/php5apache2.dll"
    as last line of the loadmodule section (there are actually lots of LoadModule ... stuff, can't miss it )
    And put
    Code:
    AddType application/x-httpd-php .php .inc
    right after those commented section
    Code:
    #
    # AddType allows you to add to or override the MIME configuration
    # file mime.types for specific file types.
    #
    Also add
    Code:
    PHPIniDir "path/to/your/phpinidir"
    (which should point to your php.ini without specifying the filename) at the end of that section
    Code:
    #
    # UserDir: The name of the directory that is appended onto a user's home
    # directory if a ~user request is received.  Be especially careful to use
    # proper, forward slashes here.  On Windows NT, "Personal/My Website"
    # is a more appropriate choice.
    #
    # UserDir "somestuff"
    PHPIniDir "..."
    [error] (OS2) The system cannot find the file specified. :No installed service named Apache2.
    For the time being you shouldn't run apache as a service until you get more into it. Try starting it manually via
    Code:
    apache.exe -k start
    Last edited by shn; Feb 9, 2006 at 02:13. Reason: Correction
    Patrick

  13. #13
    SitePoint Addict XiledWeb's Avatar
    Join Date
    May 2005
    Location
    Nashville
    Posts
    205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the detailed help, but it didn't work. I'm going to uninstall everything and reinstall.

    I checked the book again and it distinctly says "all you need to do is add the following lines to the very bottom of the file" - that's why I added them at the bottom of the conf.

    Is there a 'pulling hair out' smiley?

  14. #14
    SitePoint Evangelist vhogarth's Avatar
    Join Date
    Nov 2003
    Location
    Taxachussets
    Posts
    415
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by XiledWeb
    Thanks for the detailed help, but it didn't work. I'm going to uninstall everything and reinstall.

    I checked the book again and it distinctly says "all you need to do is add the following lines to the very bottom of the file" - that's why I added them at the bottom of the conf.

    Is there a 'pulling hair out' smiley?
    Seems like you are in need of apachefriends. It'll help you before you go bald

  15. #15
    SitePoint Addict XiledWeb's Avatar
    Join Date
    May 2005
    Location
    Nashville
    Posts
    205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


    I really want to do this without Apachefriends - this is a contest between man and machine now, I'm not backing down....

  16. #16
    SitePoint Evangelist vhogarth's Avatar
    Join Date
    Nov 2003
    Location
    Taxachussets
    Posts
    415
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by XiledWeb


    I really want to do this without Apachefriends - this is a contest between man and machine now, I'm not backing down....
    haha, ok. Well at least you know you have friends if your in need. Sitepoint that is.

  17. #17
    SitePoint Zealot
    Join Date
    Jan 2005
    Location
    USA
    Posts
    128
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The easy way install phptraid or go to http://easyphp.org download the software and u will have all Apache/phpmyadmin/php/mysql
    Favorite Site : xProxy

  18. #18
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you copying php5ts.dll to your Windows directory?
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  19. #19
    SitePoint Addict XiledWeb's Avatar
    Join Date
    May 2005
    Location
    Nashville
    Posts
    205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I uninstalled the PHP, MySQL and Apache this afternoon - I'll get back to work on this tomorrow, we're expecting a lot of snow, so it'll give me some time!

  20. #20
    SitePoint Addict XiledWeb's Avatar
    Join Date
    May 2005
    Location
    Nashville
    Posts
    205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just to let everyone know, I managed to get my local host working on the apache server I set up.. What a great feeling.

  21. #21
    SitePoint Enthusiast spamonkey8's Avatar
    Join Date
    Feb 2006
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Be sure to install Apache as a service with

    apache -k install


Bookmarks

Posting Permissions

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