Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

PHP/Apache Beginner Tips/Traps?

  • 09-05-2004 1:04pm
    #1
    Closed Accounts Posts: 8


    Hey guys, would love any help you can give me. Its my first foot on the ladder and am finding it hard to get the ball rolling, anything you can add would be great.
    Thanks.

    I am having trouble getting apache up and running, I'm running on Windows XP Home. Bought a guide to PHP but it explained in Win 2000 and I'm getting alittle lost.
    If anyone could take the time to type out a basic 10 step guide i would be very greatful, and maybe a outline a few pit falls.

    Cheers Guys :)

    skorp


Comments

  • Registered Users, Registered Users 2 Posts: 2,120 ✭✭✭p


    There's absolutley TONS of resources to setting up apache online.

    Google, about and see what you can find. Then if you still have problems come baclk to us.


  • Registered Users, Registered Users 2 Posts: 1,268 ✭✭✭hostyle


    Its easier answer particular questions, rather than give tips. Tell us what problem you are having, and you're sure to get an solution. Everyone is a beginner at some point.


  • Registered Users, Registered Users 2 Posts: 68,317 ✭✭✭✭seamus


    I always thought the install guide for Windows was pretty straightforward. If you fully read it instead of glossing over it you shouldn't have any problems.


  • Registered Users, Registered Users 2 Posts: 7,740 ✭✭✭mneylon


    If you grab one of the installation suites off Hotscripts.com you should be fine. Most of them are dead simple to setup as long as you read the manual


  • Closed Accounts Posts: 8 skorpioh


    Well basicly my problem is the configuration of the "httpd" file.
    Of the two books i bought they both tell me to configure it to host name and domain name etc.

    1) To add a command such as " -d serverroot " you can type it in the httpd anywhere or is there another location to exec this command?

    I understand your points, but I guess I'm very much out of my depth I google about for some help.
    Thanks


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 1,268 ✭✭✭hostyle


    Sorry, but thats rather unclear. You're running apache n windows? That sounds like a linux command you just mentioned?

    Have you tried running apache? And pointing your web-browser at http://127.0.0.1/ ?

    To just get it working all I've usually had to do (initially at least) is change the "DocumentRoot" value in httpd.conf, then restart apache.


  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    Buy yourself this great book

    PHP and Mysql webdevelopment SE http://www.amazon.com/exec/obidos/tg/detail/-/067232525X/102-3926126-1038501?v=glance

    An Excellent read, seriously tho if you want to get to an advanced level in php, this book will help you. I rate it 5/5


  • Closed Accounts Posts: 8 skorpioh


    Yeah my problem seems to located around the "DocumentRoot"
    I added a location and it gave me a syntax error in relation to something called "Document tree"

    http://127.0.0.1/ = The page cannot be displayed.

    Must i change the Listen IP?

    I'm sorry i cant be more clear just I'm not 100% sure what i should be telling you.
    I'm told to edit the httpd file yet it doesnt tell me which factors to change. At the bottom i have changed these details :

    <VirtualHost *:80>
    ServerAdmin webmaster@mydomain.com
    DocumentRoot /C:/Program Files/Apache Group/Apache2/interpub/www/docs/mydomain
    ServerName mydomain.com.com
    ErrorLog logs/mydomain.com.com-error_log
    CustomLog logs/mydomain.com.com-access_log common
    </VirtualHost>

    I assume there is more to edit.

    Webmonkey : I bought Apache,MySQL and PHP Web Development for Dummies :dunno: its not bad but its explaned in either a different OS(Explained in IIS) or as Hostyle said maybe even Linux.


  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    When you install apache it should by default set up. Make sure you install it as a service also so that it runs everytime you start your computer. (well that will just work for NT based systems, NT , XP, 2000 etc...)

    The document root is the real address on your computer. For example you have your folder on C: as a folder called htdocs

    Document root would = "C:\htdocs"

    By default when you install, the htdocs folder is in the apache installation directory, usually in program files. The 127.0.0.1 IP, is the local IP of your machine. When you log onto the internet you will be asigned with another IP, this IP should also redirect automatically the apache.

    I would try re installing it, it shouldn't be that hard to set it up, well at least with the windows installer wizard verison of Apache, maybe you just downloaded the files on their own and have to configure it manually then.

    This is the installer version:
    http://ftp.heanet.ie/mirrors/www.apache.org/dist/httpd/binaries/win32/apache_2.0.49-win32-x86-no_ssl.msi

    Uninstall your current version and install that. Install it as a service too, it will give you that option, as far as i know unless its MySQL i'm getting mixed up with


  • Registered Users, Registered Users 2 Posts: 1,268 ✭✭✭hostyle


    DocumentRoot /C:/Program Files/Apache Group/Apache2/interpub/www/docs/mydomain

    1. Why is there a / at the beginning?

    2. No need for it to be inside a <VirtualHost> blobl either. Search httpd.conf for DocumentRoot, there should be one near the top, not inside a Virtualhost block.


  • Advertisement
  • Closed Accounts Posts: 8 skorpioh


    WebMonkey thats what the version i got same file. It auto installed, the services auto run when i boot yes. But when i go to start i get an error, which says :

    DocumentRoot Takes one argument, Root directory of the document tree.


    Ok this is all that i have edited in the httpd file.

    ServerRoot "C:/Program Files/Apache Group/Apache2"

    ServerAdmin skorp@mydomain.com

    ServerName [url]www.mydomain.com:80[/url]

    DocumentRoot "C:/Program Files/Apache Group/Apache2/Webpages"

    <Directory "C:/Program Files/Apache Group/Apache2/Webpages">

    UserDir "My Documents/My Website"

    <VirtualHost *:80>
    ServerAdmin webmaster@mydomain.com
    DocumentRoot /C:/Program Files/Apache Group/Apache2/interpub/www/docs/mydomain
    ServerName mydomain.com.com
    ErrorLog logs/mydomain.com.com-error_log
    CustomLog logs/mydomain.com.com-access_log common
    </VirtualHost>


    Thanks alot for this guys.


  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    Create a folder on your C drive called htdocs and change the document root to

    DocumentRoot "C:/htdocs"

    Delete

    <VirtualHost *:80>
    ServerAdmin webmaster@mydomain.com
    DocumentRoot /C:/Program Files/Apache Group/Apache2/interpub/www/docs/mydomain
    ServerName mydomain.com.com
    ErrorLog logs/mydomain.com.com-error_log
    CustomLog logs/mydomain.com.com-access_log common
    </VirtualHost>

    .....Back up ur http.conf before doing this tho.


  • Registered Users, Registered Users 2 Posts: 1,268 ✭✭✭hostyle


    Originally posted by Webmonkey
    Create a folder on your C drive called htdocs and change the document root to

    DocumentRoot "C:/htdocs"


    Why bother? Hes already picked a valid path. Unless theres a spaces problem with paths for apache (in which case explaining as such would be helpful) ?


  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    Well for troubleshooting purposes, just start with a very basic path, less things can go wrong


  • Closed Accounts Posts: 8 skorpioh


    Ah super changed the DocumentRoot to "C:/htdocs", and she started with no problems/errors.
    And deleted that other stuff at the bottom.

    What the best way to test it now? :)

    http://localhost/test.php

    Test.php being the name of my test file with :

    <?php
    phpinfo();
    ?>


  • Registered Users, Registered Users 2 Posts: 1,268 ✭✭✭hostyle


    skorpioh: Feck off and try it out :) Come back if you have good "meaty" questions we can chew on. Glad we were able to help.

    Could well have been a spaces in path problem, nice one Webmonkey.


  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    :)


  • Closed Accounts Posts: 8 skorpioh


    lol ok :)

    Thanks for the help, dont worrie you'll get one soon ;)


Advertisement