Php Getting Started

Discussion in 'PHP' started by progfrog, Dec 6, 2008.

  1. #1
    hi
    I am starting to learn PHP now, i installed everything- PHP, MYSQL AND APACHE but, i am not sure where shall i write the script? you'l say in the html file . o.k but should i chane the file extenstion to .php? or to .html?

    I've tried both. in the .php the computer doesn't recognize the extension and in .html it doesn't run the script.

    so this is the question:

    what do i have to do in order to make this thing works? after installing the whole package what do i need to do in order to make thing works

    please please help!!


    Progfrog
     
    progfrog, Dec 6, 2008 IP
  2. shadow_boi

    shadow_boi Peon

    Messages:
    374
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    files need to be with .php extension.
    I assume you have set everything up properly.

    To run php, apache needs to be running, and you need to go to your browser and type in something like http://localhost to view your php file, so that your php scipt can be rendered.

    You cannot just open it from your folder directory.
     
    shadow_boi, Dec 6, 2008 IP
  3. rene7705

    rene7705 Peon

    Messages:
    233
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    maybe worth noting that apache has a specific directory from which it reads html and php files.. it's called "documentRoot", and is in your httpd.conf file in the apache directory..
    good luck :)
     
    rene7705, Dec 6, 2008 IP
  4. Hideyou

    Hideyou Peon

    Messages:
    132
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Try first a normal HTML text on your site, than you can see if your server is working. Than open a notepad or an other program to write PHP. Start scripting and save it in your FTP with the extension .php

    greets
     
    Hideyou, Dec 6, 2008 IP
  5. bread102

    bread102 Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Alright are you trying to open it directly in firefox or Internet Explorer, or accessing it via localhost?


    if your trying to directly open the file, try opening it from localhost/yourfolder/yourphpfile.php

    because your browser reads the php files like a text file. AND make sure you have port forwarding properly configured so you can access it via localhost.
     
    bread102, Dec 6, 2008 IP
  6. najafali

    najafali Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    When I was getting started with PHP I don't think I could have handled installing AMP and configuring it properly. Best thing to do is probably get hosting, upload your index.php file and see it work from there.
     
    najafali, Dec 7, 2008 IP
  7. haradeep

    haradeep Well-Known Member

    Messages:
    231
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    130
    #7
    Use WAMP server which is easy to install. www.wampserver.com.
     
    haradeep, Dec 8, 2008 IP