Jump to content


Photo

PHP/Apache problem


  • Please log in to reply
4 replies to this topic

#1 clarket

clarket
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 05 June 2003 - 12:33 PM

Hi,

I\'ve just installed Apache2 and php 4.3.1 on a Win2k PC and I\'m having a problem with it. Instead of Apache executing the PHP script it keeps downloading it and executing the script in a DOS window (because I created an association with php.exe). I think its a problem with the httpd.conf file but I\'m not sure. I have the following lines in the httpd.conf file to load the PHP module:

LoadModule php4_module \"c:/PHP/sapi/php4apache2.dll\"
ScriptAlias /php/ \"c:/php/\"
AddType application/x-httpd-php .php

Thanks,

Tony.
:?

#2 shivabharat

shivabharat
  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 05 June 2003 - 12:46 PM

window (because I created an association with php.exe)


Nops associate ur .php files toa notpad or deafult editor.

I guess apache installation is ok

Never associate .php with php.exe ok php.exe is used my webserver!!
Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks

#3 clarket

clarket
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 05 June 2003 - 01:08 PM

Thanks shivabharat,

I\'ve unassociated php with any application type. Now Apache tries to download the php script and asks me to choose/associate an aplication with it. Could it be something to do with php.ini. This is my first time installing PHP, so I\'m not too sure.

Thanks,

Tony.

#4 shivabharat

shivabharat
  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 05 June 2003 - 01:20 PM

Have u installed ur PHP properly

I guess ur web server is not recognizing the .php extension.

So redo the PHP installation if possible
Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks

#5 clarket

clarket
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 05 June 2003 - 02:04 PM

I\'ve tried re-installing PHP and it\'s still the same. I think its something to do with Apache. If I save the same file with a html extension. The HTML is shown but not the PHP. The script is pasted below and saved to a file called phptest.php (and phptest.html, will display the header but ont hello world).

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<H1>TEST</H1>

<?php
echo \"<p>Hello World</p>\";
?>

</body>
</html>




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users