Author |
|
Ihoss
Joined: 01 Oct 2007 Posts: 5
|
Posted: Mon 01 Oct '07 14:51 Post subject: apache 2.2.6 and php 5.2.4: php files do not work! |
|
|
I have installed apache and php with the following options in the respective files:
httpd.conf
LoadModule php5_module "c:/program files/php/php5apache2_2.dll"
AddType application/x-httpd-php php
# configure the path to php.ini
PHPIniDir "C:/program files/php"
php.ini
doc_root = "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\"
Visiting localhost works, I see the html page, but when I try to make a php file, it won't work. Not only is the php source there, so is the html source. The file is sent as text/plain
I have vista btw. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Mon 01 Oct '07 14:59 Post subject: |
|
|
Does your file have the right extension? only .php and not php.txt ?
Does your script contain short or long tags? e.g. <? and <?php |
|
Back to top |
|
Ihoss
Joined: 01 Oct 2007 Posts: 5
|
Posted: Mon 01 Oct '07 15:08 Post subject: |
|
|
its .php, not .php.txt
I have tested it with both <? and <?php, neither work |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Mon 01 Oct '07 17:28 Post subject: |
|
|
I missed a little typo in your posted httpd.conf
AddType application/x-httpd-php php
should be
AddType application/x-httpd-php .php
Hope it works than. |
|
Back to top |
|
Ihoss
Joined: 01 Oct 2007 Posts: 5
|
Posted: Mon 01 Oct '07 17:51 Post subject: |
|
|
nope, I have tried with and without the dot, and neither work.
One other thing: I don't seem to be able to stop the server. The taskbar icon is useless, none of the options work, and when I run the stop program from start>all programs>apache>control apache server, then a black dos windows opens and closes very quickly. It still running though. When I run restart then it restarts correctly (if there is an error in the conf file, then it tells me).
I also checked the error log, and it seems the php file is generating a lot of 304 errors. |
|
Back to top |
|
tdonovan Moderator
Joined: 17 Dec 2005 Posts: 611 Location: Milford, MA, USA
|
Posted: Mon 01 Oct '07 18:25 Post subject: |
|
|
Status 304 isn't really an error.
It tells the browser that the file hasn't been modified since it was last requested, so the browser just displays the same page as it did previously.
You might try clearing your browser cache and testing again.
-tom- |
|
Back to top |
|
Ihoss
Joined: 01 Oct 2007 Posts: 5
|
Posted: Mon 01 Oct '07 18:27 Post subject: |
|
|
had no effect |
|
Back to top |
|
Ihoss
Joined: 01 Oct 2007 Posts: 5
|
Posted: Mon 01 Oct '07 20:58 Post subject: |
|
|
So I reinstalled everything and now it works. Everything apart from the Apache Monitor. I think that might have something to do with the restricted access to the windows services. I have to click yes on the annoying vista popup to have access to the services running, but once there I can start, stop and restart it. |
|
Back to top |
|