Jump to content

Cant start php files.


Recommended Posts

Hello, I am running a Windows XP Professional Service pack 2 and am new to PHP. I have setup apache and php, and apparently I did something wrong (even though they were both the .msi installer packages). Even though apache is running, when I open hello.php (which is in c:/program files/php/cgi-bin and contains nothing but this script
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World</p>'; ?>
</body>
</html>) with internet explorer, rather than "hello world" coming up, the source code (which is in the above paranthesis) is shown. Please someone help me, I think I will otherwise become insane.

note: I am running apache
Link to comment
Share on other sites

  • 3 weeks later...
It looks like apache is not recognizing php. It might be a good idea to check that your apache's httpd.conf file to make sure you have an entry like this:

LoadModule php4_module "c:/php/sapi/php4apache2.dll"
<IfModule php4_module>
<Location />
AddType text/html .php .phps
AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php-source .phps
</Location>

</IfModule>

If your using php5, there'll be something analogous.

Good luck,

Rolf
Link to comment
Share on other sites

If you used the PHP installer then that does not mean PHP has been setup with Apache. The installer does nothing other than unpack the files to where you told PHP to be installed to. It does nothing else. However it does attempt automatically configure itself to the server you are using but this usually doesnt work out. I all ways recommend to get the zipped binaries instead. To configure Apache to parse PHP files with PHP do what rolf advised above.
Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.