phpfanphp Posted August 21, 2007 Share Posted August 21, 2007 Hi, I have a question for you, (Win 32) I installed the apache server, stopped IIS, and started Apache, and the system tray icon says "Running all Apache Services" I then go to my browser (Firefox) and try to run http://localhost/Examples/HelloWorld.php which is this: <HTML> <HEAD> <TITLE>My first PHP page</TITLE> </HEAD> <BODY> <? echo "Hello world!"; ?> </BODY> </HTML> When I run this, I all I get is the code!!! I doesn't say just: Hello World! like it should, but it rather displays the tags and everything! Any ideas? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/65896-newbie-question/ Share on other sites More sharing options...
trq Posted August 21, 2007 Share Posted August 21, 2007 Firstly, you might try using the proper <?php tags. Failing that you'll need to describe exactly how you configured Apache to run mod_php. Quote Link to comment https://forums.phpfreaks.com/topic/65896-newbie-question/#findComment-329405 Share on other sites More sharing options...
phpfanphp Posted August 21, 2007 Author Share Posted August 21, 2007 Is there something wrong with the code? I copied it character for character from a training manual. Quote Link to comment https://forums.phpfreaks.com/topic/65896-newbie-question/#findComment-329413 Share on other sites More sharing options...
Hypnos Posted August 21, 2007 Share Posted August 21, 2007 <HTML> <HEAD> <TITLE>My first PHP page</TITLE> </HEAD> <BODY> <?php echo "Hello world!"; ?> </BODY> </HTML> Quote Link to comment https://forums.phpfreaks.com/topic/65896-newbie-question/#findComment-329415 Share on other sites More sharing options...
markjoe Posted September 1, 2007 Share Posted September 1, 2007 Sidenote: Always a good idea to use proper tags "<?php", I'm surprised a 'training' manual suggested otherwise. Did you tell Apache what to do with the ".php" files? Are you missing this line in "httpd.conf": AddType application/x-httpd-php php Quote Link to comment https://forums.phpfreaks.com/topic/65896-newbie-question/#findComment-339227 Share on other sites More sharing options...
d22552000 Posted September 3, 2007 Share Posted September 3, 2007 just a side note, how do I do that funky phps source code highlitghting in httpd.conf ? whats the line to insert for that Quote Link to comment https://forums.phpfreaks.com/topic/65896-newbie-question/#findComment-340616 Share on other sites More sharing options...
wildteen88 Posted September 3, 2007 Share Posted September 3, 2007 AddType application/x-httpd-phps .phps When you request a file with a .phps extensions php will highlight and display the source code for that file. Quote Link to comment https://forums.phpfreaks.com/topic/65896-newbie-question/#findComment-340626 Share on other sites More sharing options...
d22552000 Posted September 3, 2007 Share Posted September 3, 2007 yayayyay thanks. Quote Link to comment https://forums.phpfreaks.com/topic/65896-newbie-question/#findComment-340637 Share on other sites More sharing options...
anya Posted September 26, 2007 Share Posted September 26, 2007 Hi Guys I also have the same faulty instruction manual, firefox - and the same error when I try to open php files, I can see the whole code. Sorry for being thick but the part about telling apache what to do left me flummoxed. I downloaded the wamp5 package so everything was installed automatically. Would be very grateful for any suggestions! Cheers Anya Quote Link to comment https://forums.phpfreaks.com/topic/65896-newbie-question/#findComment-356001 Share on other sites More sharing options...
chillininvt Posted October 8, 2007 Share Posted October 8, 2007 If php is ran like a CGI you need to specify the path to php in the top of the file similarly to the way you would a perl script #!/path/to/php so that the script knows where to find the php engine. Quote Link to comment https://forums.phpfreaks.com/topic/65896-newbie-question/#findComment-364529 Share on other sites More sharing options...
d22552000 Posted October 8, 2007 Share Posted October 8, 2007 I though thte top line was just for permission... hmm weird if it actually tells it were to get hten scripts and apache for linux is programmed rly badly lol. Quote Link to comment https://forums.phpfreaks.com/topic/65896-newbie-question/#findComment-364558 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.