This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Could not able to run first script

 
Ranch Hand
Posts: 87
Android Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new here.
I could not able to run my first script. I am using Windows XP.
First I have installed Apache server httpd-2.2.21-win32-x86-no_ssl.msi . I also installed PHP php-5.3.8-nts-Win32-VC9-x86.msi .
On the Apache Service Monitor I can Start, Stop server.
On the command prompt I got the details such as PHP version, built date,time etc. by executing php -v command.
On the browser I got "It works!" when I typed address http://localhost/
I placed phpinfo.php file in "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs".
My problem is I am getting output code of my PHP file phpinfo.php

The contains of file phpinfo.php
<html>
<body>

<?php
phpinfo();
?>

</body>
</html>

I am getting output as

<html>
<body>

<?php
phpinfo();
?>

</body>
</html>


Please help me!
Thanks in Advance.
 
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not so simple, unfortunately.
The problem is that apache needs to be told that if a .php is requested, send it to the PHP interpreter. The way to do it is to have a line like "LoadModule php5_module "/your_php_installation_path/php5apache2.dll" in httpd.conf and configure it as a MIME module. Search for tutorials on net if you want to get into that stuff.
However, if you just want to start with PHP as quickly as possibly, then you're better off installing a preconfigured Apache + PHP + mysql stack like XAMPP or WAMP -it'll have everything already configured.
 
Aniket S. Kulkarni
Ranch Hand
Posts: 87
Android Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Karthik Shiraly.
I have downloaded & installed WampServer2.3-beata-x32.exe
Now, I can run my PHP scripts. I am very happy!!!
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
! I'd no idea WAMP is a secret to happiness.
 
Yes, of course, and I accept that blame. In fact, i covet that blame. As does this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic