Confused about WAMP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sayub
    New Member
    • Apr 2010
    • 10

    Confused about WAMP

    I am using WAMP to run my PHP scripts. I am not using short tags. When I select localhost and then the project it shows the whole script including the tags. I just want the ouput to be shown. Please help...
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    then you need to tell the server (apache) to handle .php files via the PHP interpreter, usually put in the httpd.conf file (apache configuration). (something like AddType application/x-httpd-php .php)

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      Can you post the code that is not working? I have a feeling you may be using short-tags (<?) as opposed to the full ones (<?php).

      Comment

      • sayub
        New Member
        • Apr 2010
        • 10

        #4
        Thanks for the quick response guys. Following is a very basic code,

        <?php

        echo "Hello World";

        ?>

        And I am not using the short tags.
        and the httpd.conf file already has the line 'AddType application/x-httpd-php .php3'.

        But the php tags are still not being parsed, meaning the whole script is being displayed in raw form inclucing the php tags.

        Comment

        • Dormilich
          Recognized Expert Expert
          • Aug 2008
          • 8694

          #5
          rename your file to .php3 or change .php3 to .php in the conf file.

          Comment

          • sayub
            New Member
            • Apr 2010
            • 10

            #6
            Hi, I have switched WAMP with WAMP 2, but having the same problem. Any ideas?

            Comment

            • Dormilich
              Recognized Expert Expert
              • Aug 2008
              • 8694

              #7
              same ideas as before …

              Comment

              • Atli
                Recognized Expert Expert
                • Nov 2006
                • 5062

                #8
                Dormilich has already told you how to fix this manually, but if you can't/won't do that, you could also try replacing WAMP with XAMPP. I've found it more reliable. (Usually works "out-of-the-box" with no problems.)

                Comment

                • sayub
                  New Member
                  • Apr 2010
                  • 10

                  #9
                  Actually the problem was elsewhere. I was using dreamweaver as my editing tool. Now, dreamweaver has a code section and a design section. I, accidentally, put my code in the design section and then tried to run it which just did not work. A friend of mine brought the problem to light.

                  Comment

                  • Atli
                    Recognized Expert Expert
                    • Nov 2006
                    • 5062

                    #10
                    Ahh I see.

                    I've never found Dreamweaver all that good when working on PHP code. It's more of a HTML/CSS design tool. It's coding functionality is kind of lacking. (For PHP, anyways.)

                    You should try something like Netbeans, Eclipse with PDT, or even Aptana. -- All of which are free, and with better PHP development tools than Dreamweaver.

                    Comment

                    Working...