470,833 Members | 1,410 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

.PHP code does not parse php5 Apache2 on windows

Can anyone tell me why .php code is not parsed
#For PHP 5:
short_open_tag = Off
httpd.conf
# Add to the end of the LoadModule section
LoadModule php5_module "C:/PHP/php5apache2.dll"
AddType application/x-httpd-php .php
#Add to the end of the AddModule section
#AddModule mod_php5.c
Mike

Apr 4 '06 #1
18 2483
Massa Batheli wrote:
Can anyone tell me why .php code is not parsed
#For PHP 5:
short_open_tag = Off
httpd.conf
# Add to the end of the LoadModule section
LoadModule php5_module "C:/PHP/php5apache2.dll"
AddType application/x-httpd-php .php
#Add to the end of the AddModule section
#AddModule mod_php5.c
Mike


It should be. Are your files named xxx.php?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 4 '06 #2
Thanks for your response Jerry .It should be but actually it is not .
My files do end with a php

My results look like

Hi <?php echo $_POST['name']; ?>.
You are <?php echo $_POST['age']; ?> years old.

cut and paste from

http://us3.php.net/manual/en/tutorial.forms.php

Apr 4 '06 #3
Massa Batheli wrote:
Thanks for your response Jerry .It should be but actually it is not .
My files do end with a php

My results look like

Hi <?php echo $_POST['name']; ?>.
You are <?php echo $_POST['age']; ?> years old.

cut and paste from

http://us3.php.net/manual/en/tutorial.forms.php


Do you have a page where we can look at it to see what's happening? It works
just fine here.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 4 '06 #4
after setting this, did you stop/restart the web server? Your biggest
problem is that you are using windows as a server....
bbblllleeeeccccchhh!

create a page with

--- cut here ---
<?php phpinfo(); ?>
--- cut here ---
what do you get?

Apr 4 '06 #5
d
<on*******@firstdbasource.com> wrote in message
news:11**********************@z34g2000cwc.googlegr oups.com...
after setting this, did you stop/restart the web server? Your biggest
problem is that you are using windows as a server....
Windows works just fine as a web server.
bbblllleeeeccccchhh!

create a page with

--- cut here ---
<?php phpinfo(); ?>
--- cut here ---
what do you get?

Apr 4 '06 #6
on*******@firstdbasource.com wrote:

after setting this, did you stop/restart the web server? Your biggest
problem is that you are using windows as a server....
bbblllleeeeccccchhh!


BS. I've been using Apache with PHP and MySQL on Windows XP for years
and it works like a charm. Never had any problems, except for the well
known problem that Apache 2 has with XP without SP1 or greater.

Bye!
Apr 4 '06 #7
Phpinfo() shows up just fine with no errors .Apache test page shows up
just fine too.
When the .php files are replaced with .html then everything shows up
fine but for the values
in a form
I am sorry there is no test page yet to show, rebooted the laptop not
only restarted the services
Thanks a lot for your responses and hope one of you comes up with what
is needed

Massa Batheli

Apr 4 '06 #8
On Tue, 04 Apr 2006 09:27:18 -0400, Massa Batheli <mn****@yahoo.com> wrote:
Can anyone tell me why .php code is not parsed
#For PHP 5:
short_open_tag = Off
httpd.conf
# Add to the end of the LoadModule section
LoadModule php5_module "C:/PHP/php5apache2.dll"
AddType application/x-httpd-php .php
#Add to the end of the AddModule section
#AddModule mod_php5.c

Don't you want to uncomment that last line? Should be:

AddModule mod_php5.c
Apr 4 '06 #9
In order to have a .HTML "execute" php commands, you must have html as
an addtype of AddType application/x-httpd-php - and you can only have
one AddType for each file extension.

PHP is working (if phpinf() works - it is configured correctly)

use a somewhat non-standard file extension -- something like:

AddType application/x-httpd-php .php .phtml

and rename your file to *.phtml

as for the other comments concerning windows: .. and your site gets how
many hits a day?

Apr 4 '06 #10


when addmodule is uncommented apache cannot be restarted
Would like to have .php working for now and worry about .phtml later
thanks so much for the responses
Thanks

Apr 4 '06 #11
okay... from a previous post you said that the phpinfo(); page was
working.. I assumed you had named it xxx.php and it displayed correctly
- is that not the case?

there should be an:

AddType application/x-httpd-php .php .phtml
(or similar line in either a mod_php.conf file or in the httpd.conf
file. without this directive, .php files cannot be "parsed".

Q: take a closer look at:

LoadModule php5_module "C:/PHP/php5apache2.dll"

shouldn't that be:
LoadModule php5_module "C:\PHP\php5apache2.dll"
maybe not - for real work, I don't do windows :)

Apr 4 '06 #12

on*******@firstdbasource.com wrote:
okay... from a previous post you said that the phpinfo(); page was
working.. I assumed you had named it xxx.php and it displayed correctly
- is that not the case?

there should be an:

AddType application/x-httpd-php .php .phtml
(or similar line in either a mod_php.conf file or in the httpd.conf
file. without this directive, .php files cannot be "parsed".

Q: take a closer look at:

LoadModule php5_module "C:/PHP/php5apache2.dll"

shouldn't that be:
LoadModule php5_module "C:\PHP\php5apache2.dll"
maybe not - for real work, I don't do windows :)


I appreciate your time but will like to share this with you. The
phpinfo.php page works wether front or back slashes are applied but
code is not still parsed.
What could be messed up here ...............
Massa bathe

Apr 5 '06 #13
Massa Batheli wrote:
on*******@firstdbasource.com wrote:
okay... from a previous post you said that the phpinfo(); page was
working.. I assumed you had named it xxx.php and it displayed correctly
- is that not the case?

there should be an:

AddType application/x-httpd-php .php .phtml
(or similar line in either a mod_php.conf file or in the httpd.conf
file. without this directive, .php files cannot be "parsed".

Q: take a closer look at:

LoadModule php5_module "C:/PHP/php5apache2.dll"

shouldn't that be:
LoadModule php5_module "C:\PHP\php5apache2.dll"
maybe not - for real work, I don't do windows :)


I appreciate your time but will like to share this with you. The
phpinfo.php page works wether front or back slashes are applied but
code is not still parsed.
What could be messed up here ...............
Massa bathe


Some questions:
1. what is in your apache2/logs/errors.log file? Anything relevant?
2. have you tried a really simple php file?
For example:
<?php
echo "<h1>Hi there</h1>";
?>

3. where are the pages that are not being served? In the same place as
the phpinfo?

-david-

Apr 5 '06 #14
Both pages are on the desktop
..The html page and the .php form processing page

Apr 5 '06 #15
David

The apache logs seem fine at least no errors that seem to ring a bell .
The simple PHP file you showed me is opened as a text file .
It is only opened with a browser if encapsulated in html.Please let me
know if that
is any hint to the problem

Massa Bathe

Apr 5 '06 #16
You said these are on your "desktop"???? Php will not "execute" from
your desktop. The files should be located in your apache directory
under htdocs and should be accessed via a web browser using your PC in
the address bar.

in IE: http://192.168.1.x/test.php

if you want to use command-line you must go to a cmd window and at the
prompt execute:
C:\where\ever\your\php.exe test.php

there is probably some way to make a .php file associated with your php
executable.

Apr 5 '06 #17
Massa Batheli wrote:
David

The apache logs seem fine at least no errors that seem to ring a bell .
The simple PHP file you showed me is opened as a text file .
It is only opened with a browser if encapsulated in html.Please let me
know if that
is any hint to the problem

Massa Bathe


Ah, now the problem.

To get it to execute the PHP code, you MUST go through your web server - that
is, open a browser and access it with something like http://localhost/mypage.php.

Doing a File->Open in the browser or using any other tool to open it will not
execute the PHP code.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 5 '06 #18
Jerry David and all thanks a lot .
**Problem resolved**
Massa Bathe

Apr 5 '06 #19

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by FL | last post: by
6 posts views Thread by somaBoy MX | last post: by
4 posts views Thread by >>-Archer--> | last post: by
12 posts views Thread by Sarah Tanembaum | last post: by
reply views Thread by TheClair | last post: by
7 posts views Thread by SKUNKFACEWOODY | last post: by
12 posts views Thread by Alan M Dunsmuir | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.