Author |
|
Caislean
Joined: 03 Feb 2007 Posts: 5
|
Posted: Sat 03 Feb '07 22:48 Post subject: Apache + PHP either crashes or doesn't execute |
|
|
I set up Apache 2.2.4 and PHP 5.2.0 on a Windows XP pro box. Apache starts fine and claims to have the php module loaded. If I go to a .html file that has php in it, none of the php executes. (I made a simple html file that adds to variables and displays the results). If I go to a .php file the Apache crashes.
(In case anyone wonders, the .html contains this junk: <?php $a = 5; $b = 2; $c = $a + $b; echo $c; ?>
I'm not sure where to start trouble shooting this at, so any suggestions would be nice. What have I most likely configured wrong?
Last edited by Caislean on Sun 04 Feb '07 0:58; edited 1 time in total |
|
Back to top |
|
coldasice
Joined: 02 Jan 2007 Posts: 20
|
Posted: Sat 03 Feb '07 23:30 Post subject: |
|
|
u have to allow .php in ur apache conf
if u havent done that already.. then u make a .php file.. >.> maby that will work
ps. it has to end ?> |
|
Back to top |
|
Caislean
Joined: 03 Feb 2007 Posts: 5
|
Posted: Sun 04 Feb '07 0:55 Post subject: |
|
|
That was a little unspecific (the allowing php), but if you mean this:
<Directory "C:/Propgram Files/PHP">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
then I've already done that, and still the server either crashes or doesn't run the php. And yes, the php in the html code is tagged properly (i.e. it starts with <?php and ends with ?> |
|
Back to top |
|
coldasice
Joined: 02 Jan 2007 Posts: 20
|
Posted: Sun 04 Feb '07 2:03 Post subject: |
|
|
aww!!! lol.. sorry mate.. i didnt read what u typed.. good enought..
well lol sorry.. but it if apache crashes.. on .php load.. then its the apache thats the problem.. >.>
installing maby 2.0.59 =D or somthing =D
unless some one else know the anser =D |
|
Back to top |
|
Caislean
Joined: 03 Feb 2007 Posts: 5
|
Posted: Sun 04 Feb '07 2:07 Post subject: |
|
|
I can see the php code in the .html when I view the source, so I know something isn't set up quite right.
I stopped the crashing by switching some forward slashes to backward slashes, so that isn't a problem any more.
Here are the lines I have in my apache configuration file (that concern php):
PHPIniDir "C:\PHP\"
LoadModule php5_module "C:\PHP\php5apache2_2.dll"
AddType application/x-httpd-php .php
AddHandler application/x-httpd-php .php .php3
Action application/x-httpd-php "c:/php/php.exe" |
|
Back to top |
|
Caislean
Joined: 03 Feb 2007 Posts: 5
|
Posted: Sun 04 Feb '07 2:52 Post subject: |
|
|
So, I can get .php files to execute from the command line, and apache is running perfectly, my configuration files seem to be okay... so what am I missing?
Why can I still see the source code when I view the .html files (ie - i can see all the php code)? |
|
Back to top |
|
coldasice
Joined: 02 Jan 2007 Posts: 20
|
Posted: Sun 04 Feb '07 5:22 Post subject: |
|
|
here is a handy trick..
turn off the apache server..
go to apache folder.. go bin.. and dubble click on httpd.exe .. there will cmd open.. and all errors list if there are any
btw try remove the phpinidir =D |
|
Back to top |
|
Caislean
Joined: 03 Feb 2007 Posts: 5
|
Posted: Sun 04 Feb '07 7:18 Post subject: |
|
|
Apache has no errors and removing phpinidir does nothing. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Sun 04 Feb '07 19:21 Post subject: |
|
|
Disable all extentions in php.ini and see if it works than. |
|
Back to top |
|
waldgeist
Joined: 22 Feb 2007 Posts: 1
|
Posted: Thu 22 Feb '07 20:07 Post subject: Had the same problem |
|
|
This problem occurs, if you use the PHP msi installer and select all extensions (as I did). In this case, some .dlls cannot be loaded by Apache. This can be seen if you call the /bin/http.exe from the Apache installation directly (i.e. without running the service). Once I disabled all extensions, php worked. |
|
Back to top |
|