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 + PHP either crashes or doesn't execute
Author
Caislean



Joined: 03 Feb 2007
Posts: 5

PostPosted: Sat 03 Feb '07 22:48    Post subject: Apache + PHP either crashes or doesn't execute Reply with quote

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

PostPosted: Sat 03 Feb '07 23:30    Post subject: Reply with quote

u have to allow .php in ur apache conf Wink

if u havent done that already.. then u make a .php file.. >.> maby that will work Wink

ps. it has to end ?>
Back to top
Caislean



Joined: 03 Feb 2007
Posts: 5

PostPosted: Sun 04 Feb '07 0:55    Post subject: Reply with quote

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

PostPosted: Sun 04 Feb '07 2:03    Post subject: Reply with quote

aww!!! lol.. sorry mate.. i didnt read what u typed.. good enought.. Wink

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

PostPosted: Sun 04 Feb '07 2:07    Post subject: Reply with quote

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

PostPosted: Sun 04 Feb '07 2:52    Post subject: Reply with quote

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

PostPosted: Sun 04 Feb '07 5:22    Post subject: Reply with quote

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 Wink if there are any

btw try remove the phpinidir =D
Back to top
Caislean



Joined: 03 Feb 2007
Posts: 5

PostPosted: Sun 04 Feb '07 7:18    Post subject: Reply with quote

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

PostPosted: Sun 04 Feb '07 19:21    Post subject: Reply with quote

Disable all extentions in php.ini and see if it works than.
Back to top
waldgeist



Joined: 22 Feb 2007
Posts: 1

PostPosted: Thu 22 Feb '07 20:07    Post subject: Had the same problem Reply with quote

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


Reply to topic   Topic: Apache + PHP either crashes or doesn't execute View previous topic :: View next topic
Post new topic   Forum Index -> Other Software