Apache 2.2.4 & PHP 5.2.4

Apache 2.2.4 & PHP 5.2.4

am 26.09.2007 03:17:40 von Craig

I have been working on this for two days, and cannot figure it out. I have
read and tried suggestions from previous posts.

The phpinfo file comes up ok, put when I run a php page it only shows the
html, no PHP output.

I have installed Apache 2.2.4 and PHP 5.2.4 on Windows XP. Services show
"Apache/2.2.4 (Win32) PHP/5.2.4" running.

I have installed Apache in C:\Apache2.2, PHP is installed in
C:\Apache2.2\PHP524. php.ini and php5apache2_2.dll are both in
C:\Apache2.2\PHP524.

The Apache httpd.conf file has:
AddType application/x-httpd-php .php

and at the bottom

#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
PHPIniDir "C:/Apache2.2/PHP524/"
LoadModule php5_module "C:/Apache2.2/PHP524/php5apache2_2.dll"
#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL

The php.ini has:

; Directory in which the loadable extensions (modules) reside.
extension_dir = "C:\Apache2.2\PHP524\ext\"

In a book that I have, it mentions adding the LoadModule and AddType lines,
but also mentions to insert AddModule mod_php5.c. When I add AddModule
mod_php5.c, Apache will not start. It comes up with this error"

Services
Windows could not start the apache2 on Local Computer. For more information,
review the System Event Log. If this is a non-Microsoft service, contact the
service vendor, and refer to service-specific error code 1.

When I remove AddModule mod_php5.c Apache loads fine.

I've tried to explain with as much detail as I could.

Any help would be greatly appreciated.

Craig

PS - I also posted this in the php.install group, as I am not sure if this
is an Apache or PHP problem.

Re: Apache 2.2.4 & PHP 5.2.4

am 27.09.2007 01:20:51 von shimmyshack

On Sep 26, 2:17 am, "Craig" wrote:
> I have been working on this for two days, and cannot figure it out. I have
> read and tried suggestions from previous posts.
>
> The phpinfo file comes up ok, put when I run a php page it only shows the
> html, no PHP output.
>
> I have installed Apache 2.2.4 and PHP 5.2.4 on Windows XP. Services show
> "Apache/2.2.4 (Win32) PHP/5.2.4" running.
>
> I have installed Apache in C:\Apache2.2, PHP is installed in
> C:\Apache2.2\PHP524. php.ini and php5apache2_2.dll are both in
> C:\Apache2.2\PHP524.
>
> The Apache httpd.conf file has:
> AddType application/x-httpd-php .php
>
> and at the bottom
>
> #BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
> PHPIniDir "C:/Apache2.2/PHP524/"
> LoadModule php5_module "C:/Apache2.2/PHP524/php5apache2_2.dll"
> #END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
>
> The php.ini has:
>
> ; Directory in which the loadable extensions (modules) reside.
> extension_dir = "C:\Apache2.2\PHP524\ext\"
>
> In a book that I have, it mentions adding the LoadModule and AddType lines,
> but also mentions to insert AddModule mod_php5.c. When I add AddModule
> mod_php5.c, Apache will not start. It comes up with this error"
>
> Services
> Windows could not start the apache2 on Local Computer. For more information,
> review the System Event Log. If this is a non-Microsoft service, contact the
> service vendor, and refer to service-specific error code 1.
>
> When I remove AddModule mod_php5.c Apache loads fine.
>
> I've tried to explain with as much detail as I could.
>
> Any help would be greatly appreciated.
>
> Craig
>
> PS - I also posted this in the php.install group, as I am not sure if this
> is an Apache or PHP problem.

you say:

The phpinfo file comes up ok, put when I run a php page it only shows
the
html, no PHP output.

So how are you getting the phpinfo file to show?

file called test.php
phpinfo();
?>

if thats ok, then

file called html_and_php.php


should be fine too.

Re: Apache 2.2.4 & PHP 5.2.4

am 27.09.2007 01:21:29 von shimmyshack

On Sep 26, 2:17 am, "Craig" wrote:
> I have been working on this for two days, and cannot figure it out. I have
> read and tried suggestions from previous posts.
>
> The phpinfo file comes up ok, put when I run a php page it only shows the
> html, no PHP output.
>
> I have installed Apache 2.2.4 and PHP 5.2.4 on Windows XP. Services show
> "Apache/2.2.4 (Win32) PHP/5.2.4" running.
>
> I have installed Apache in C:\Apache2.2, PHP is installed in
> C:\Apache2.2\PHP524. php.ini and php5apache2_2.dll are both in
> C:\Apache2.2\PHP524.
>
> The Apache httpd.conf file has:
> AddType application/x-httpd-php .php
>
> and at the bottom
>
> #BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
> PHPIniDir "C:/Apache2.2/PHP524/"
> LoadModule php5_module "C:/Apache2.2/PHP524/php5apache2_2.dll"
> #END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
>
> The php.ini has:
>
> ; Directory in which the loadable extensions (modules) reside.
> extension_dir = "C:\Apache2.2\PHP524\ext\"
>
> In a book that I have, it mentions adding the LoadModule and AddType lines,
> but also mentions to insert AddModule mod_php5.c. When I add AddModule
> mod_php5.c, Apache will not start. It comes up with this error"
>
> Services
> Windows could not start the apache2 on Local Computer. For more information,
> review the System Event Log. If this is a non-Microsoft service, contact the
> service vendor, and refer to service-specific error code 1.
>
> When I remove AddModule mod_php5.c Apache loads fine.
>
> I've tried to explain with as much detail as I could.
>
> Any help would be greatly appreciated.
>
> Craig
>
> PS - I also posted this in the php.install group, as I am not sure if this
> is an Apache or PHP problem.

i meant



of course

Re: Apache 2.2.4 & PHP 5.2.4

am 27.09.2007 08:13:07 von David McKenzie

Craig wrote:
> I have been working on this for two days, and cannot figure it out. I have
> read and tried suggestions from previous posts.
>
> The phpinfo file comes up ok, put when I run a php page it only shows the
> html, no PHP output.

What's the filename of the phpinfo file and the php page you're using?


--
DM davidm@cia.com.au

'It would go against respecting principles and truth if you have to
respect and accept anything just because it is the other side's view.'
- Kim Jung Ill

Re: Apache 2.2.4 & PHP 5.2.4

am 27.09.2007 17:18:05 von dvader

> The phpinfo file comes up ok, put when I run a php page it only shows the
> html, no PHP output.

On your troubled PHP page, are you using a short open tag ( default full open tag ( set to "On" if you want to use the tag without "PHP."
--
Crash

Re: Apache 2.2.4 & PHP 5.2.4

am 28.09.2007 18:02:24 von Craig

When I run this file:

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">




Hello!



THIS LINE IS HTML - NOT PHP!


echo("Hello, World! If you see this line, you are successfully running PHP
5.2.4 an the Apache web server.");
?>





I get:

THIS LINE IS HTML - NOT PHP!
Hello, World! If you see this line, you are successfully running PHP 5.2.4
an the Apache web server.

When I run this file (tips.txt is in the htdocs directory):




Tip of the day



TRICK
TRAP
TRICK

Tip of the day




readfile("tips.txt");

?>





I get:

TRICK TRAP TRICK
Tip of the day

Warning: readfile("tipstxt") [function.readfile]: failed to open stream: No
such file or directory in C:\Apache2.2\htdocs\tip.php on line 25


When I run this file:



Hi Jacob


Hi Jacob


Demonstrates using a variable


$userName = "Jacob";
print "Hi, $userName";
?>



I get:

Parse error: syntax error, unexpected ',' in C:\Apache2.2\htdocs\hijacob.php
on line 10

I remove the ',' in print "Hi, $userName", I get:

Parse error: syntax error, unexpected T_VARIABLE in
C:\Apache2.2\htdocs\hijacob.php on line 10


Craig