Getting started with PHP and helloworld not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rotaryfreak
    New Member
    • Oct 2008
    • 74

    Getting started with PHP and helloworld not working

    hi everyone,

    i want to start learning php and how to develop with it. I downloaded wampserver and installed it without any complications. I then turned to some ebooks for documentation and started coding. However, all the examples i've tried so far have now been working.
    for example:
    Code:
    html>
    	<body>
    
    		<?php
    			echo "Hello World";
    		?>
    
    	</body>
    </html>
    is supposed to display hello world but when i view it in a browser, all i get is a blank page.

    are there any additional settings that need to be configured? or am i doing something wrong? btw, im using Notepad++ as my editor

    thanks in advance
  • JKing
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    #2
    Originally posted by rotaryfreak
    hi everyone,

    i want to start learning php and how to develop with it. I downloaded wampserver and installed it without any complications. I then turned to some ebooks for documentation and started coding. However, all the examples i've tried so far have now been working.
    for example:
    Code:
    html>
    	<body>
    
    		<?php
    			echo "Hello World";
    		?>
    
    	</body>
    </html>
    is supposed to display hello world but when i view it in a browser, all i get is a blank page.

    are there any additional settings that need to be configured? or am i doing something wrong? btw, im using Notepad++ as my editor

    thanks in advance
    Do you have your waamp server properly configured and running?

    Have you placed your php file in the right directory?

    Are you accessing the file properly in your browser ie localhost/pagename.php if you have placed it in the root directory.

    Comment

    • rotaryfreak
      New Member
      • Oct 2008
      • 74

      #3
      i think my wampserver is configured properly... i havent changed any of the default settings. The php file is in the right directly ...Wamp Server\www\hell o.php and im accessing the file through Nopepad++. It has an option Run > Launch In Firefox and i can see the file location in the address bar :
      file:///C:/Program Files/Wamp Server/www/hello.php

      Comment

      • labmonkey111
        New Member
        • Sep 2008
        • 44

        #4
        Originally posted by rotaryfreak
        i think my wampserver is configured properly... i havent changed any of the default settings. The php file is in the right directly ...Wamp Server\www\hell o.php and im accessing the file through Nopepad++. It has an option Run > Launch In Firefox and i can see the file location in the address bar :
        file:///C:/Program Files/Wamp Server/www/hello.php
        To get the file to run through php, you will need to access it like this:



        Otherwise your browser is trying to open the raw php source, and not php's output.

        Comment

        • rotaryfreak
          New Member
          • Oct 2008
          • 74

          #5
          great! it worked, thank you very much. i greatly appreciate it :)

          Comment

          Working...