logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: apache 2.2.6 and php 5.2.4: php files do not work!
Author
Ihoss



Joined: 01 Oct 2007
Posts: 5

PostPosted: Mon 01 Oct '07 14:51    Post subject: apache 2.2.6 and php 5.2.4: php files do not work! Reply with quote

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

PostPosted: Mon 01 Oct '07 14:59    Post subject: Reply with quote

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

PostPosted: Mon 01 Oct '07 15:08    Post subject: Reply with quote

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

PostPosted: Mon 01 Oct '07 17:28    Post subject: Reply with quote

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

PostPosted: Mon 01 Oct '07 17:51    Post subject: Reply with quote

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

PostPosted: Mon 01 Oct '07 18:25    Post subject: Reply with quote

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

PostPosted: Mon 01 Oct '07 18:27    Post subject: Reply with quote

had no effect Sad
Back to top
Ihoss



Joined: 01 Oct 2007
Posts: 5

PostPosted: Mon 01 Oct '07 20:58    Post subject: Reply with quote

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


Reply to topic   Topic: apache 2.2.6 and php 5.2.4: php files do not work! View previous topic :: View next topic
Post new topic   Forum Index -> Other Software