urgent.....PHP and Apache configuration

Neha Kochhar

Neha Kochhar

@neha-kochhar-6BG7H3 Oct 26, 2024
hello....i have installed apache2.2 on my laptop alongwith php5 .
when i test <?php phpinfo() ?> ,it shows configuration and works...but when i run my own created php page .it does not work and display only the html content. pls help me ...to know whether my php 5 in installed properly.
and apache is configured properly..

or give me steps to install php5 and to configure apache 2.2 server....its really urgent

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Kaustubh Katdare

    Kaustubh Katdare

    @thebigk May 22, 2009

    If PHPINFO works fine, PHP & Apache installation is alright.

    Could you share the code of your php page with us? Looks like the problem lies there.
  • Prasad Ajinkya

    Prasad Ajinkya

    @prasad-aSUfhP May 22, 2009

    Neha, could you paste your code in here?

    Or do one thing, in your configuration, enable warnings. So that all the interpretation errors are thrown on your screen. If that is so, then please copy paste that error in here.
  • Neha Kochhar

    Neha Kochhar

    @neha-kochhar-6BG7H3 May 22, 2009

    I have craeted a html page named test1.html in htdocs folder of Apache and coding of that html page is
    <html>
    <body>

    <form action="welcome.php" method="post">
    Name: <input type="text" name="fname" />
    Age: <input type="text" name="age" />
    <input type="submit" />
    </form>

    </body>
    </html>



    and the php page that will be submitted on clicking submit is welcome.php and is also placed in same htdocs folder and is coding is as follows:

    <html>
    <body>

    Welcome <?php print $_POST["fname"]; ?>!<br />
    You are <?php print $_POST["age"]; ?> years old.

    </body>
    </html>


    but the problem is that it is displaying only Welcome! and You are years old.

    It is not picking values from that html page....

    pls help me out of this....
  • Kaustubh Katdare

    Kaustubh Katdare

    @thebigk May 23, 2009

    It works very well on my system.

    Make sure you've placed both the files in the same directory under apache's htdocs folder.
  • Neha Kochhar

    Neha Kochhar

    @neha-kochhar-6BG7H3 May 23, 2009

    I have placed both test1.html and welcome.php in htdocs folder.
    but when i click on test1.html ,page open in IE and i enter name and age ,then click on submit query then page opens and displays only welcome!
    you are years old.
    whats the problem?
  • Neha Kochhar

    Neha Kochhar

    @neha-kochhar-6BG7H3 May 23, 2009

    yes i got it.its working now.actually i was not running that html page through localhost .i was directly clicking on it. thanks
  • Kaustubh Katdare

    Kaustubh Katdare

    @thebigk May 23, 2009

    Good that you solved the problem yourself. All the best!
  • shalini_goel14

    shalini_goel14

    @shalini-goel14-ASmC2J May 25, 2009

    I was recently going through a piece of code in php, I could not distinguish between usage of "echo" and "print" keyword in it. Anyone has any ideas about the difference between the two? 😕
  • spartan

    spartan

    @spartan-GZQJ4M May 26, 2009

    I was recently going through a piece of code in php, I could not distinguish between usage of "echo" and "print" keyword in it. Anyone has any ideas about the difference between the two? 😕

    hope this will help you
    #-Link-Snipped-#