Only issue, which I'm sure is just a configuration one: I have a number of html forms in a folder on my server that call php scripts I've written for various things. They worked fine on apache 2.0.55.

Now that I've upgraded to apache 2.2.0, here's what happens:

the html files display fine when viewed in a browser through apache but but when I submit the forms and they take me to the php scipts, the php scripts no longer seem to actually run. Instead, they output php source code that looks something like this:

Code:

"Not Enrolled"' : ''; // if you include the for statement, that will temporarily add in concept that we will print out end of month for each month from 9/30/202 to 2/28/05 // for($single_date = '2002/10/01'; $single_date <= '2005/03/01'; $single_date = date("Y/m/d", strtotime($single_date . "+1 month"))) // { // now, get and dump the answer if asking for a single date if( $mode == 'single_date' ) { // begin by compiling the single date (and make sure it doesn't go beyond the last db date) $single_date = $single_date_year . '/' . $single_date_month . '/' . $single_date_day; $single_date = ( strtotime($single_date) <= strtotime($last_db_date) ) ? $single_date : $last_db_date; // now test who is there on a particular date... $sql = "SELECT firstname, lastname FROM bio WHERE ( ( arrived1 IS NOT NULL AND arrived1 <= '$single_date' AND (left1 > '$single_date' OR left1 IS NULL) ) OR ( arrived2 IS NOT NULL AND arrived2 <= '$single_date' AND (left2 > '$single_date' OR left2 IS NULL) ) ) $sql_exclude ORDER BY lastname"; $result = mysql_query($sql); if(!$result) { echo "Failed to obtain db information"; } if (mysql_error()) { echo "Error Report: ".mysql_error()."

"; } $headcount = mysql_num_rows($result); echo '

I know I've got apache set up correctly to run php scripts generally since my phpbb board works fine...any idea what setting I need to tweak to get these other scripts working again?

THanks for responding (and so quickly!). I have pasted a sample of one of the problem html forms below. As you can see, the first line of the code tells the html to redirect to headcount.php when the user clicks to submit the form. It should redirect and execute the script called headcount.php (and it did that perfectly in apache 2.0.55), but instead it displays the source code of headcount.php in the browser. Anyway, here's the html form:

Right, the phpbb and webcalendar html forms redirect to php scripts that execute fine too. It's just that one set of html forms that redirects in a way where apache doesn't run the script but instead shows the source. That set is in a different subdirectory a few levels down underneath htdocs, but I don't see why that would make any difference.

Bottom line: I know there is nothing wrong with the html forms or the php scripts they redirect to (they work fine with my apache 2.0.55 setup). It's clearly something funny I've done with the conf files in apache 2.2 so that those forms in that directory redirect in a way so that apache doesn't know to execute the php script. Does that ring a bell at all?

With regards to being able to use <? in PHP script or not, that is purely a PHP Configuration Issue...not Apache.

In PHP, it is referred to by most as Short Tags. Different people have different opinions on using short tags. It really doesn't hurt anything to use short tags, but there are purist out there who like adhering to current standards and would rather not use anything that is considered deprecated.

In the PHP.INI file, locate the directive short_open_tag. If it is set to OFF, then that is why <? was not working.

As far as 'pushing out' raw PHP, I have seen this before. I cannot remember exactly what is was, but it was definitely a PHP Configuration Issue (might have been a missing opening tag issue - which react similiarly to what you are experiencing). Comb through your PHP.INI, and compare it to the last working PHP.INI file. It sounds like you should try turning on short tags. I might be wrong, but I'll take it on the chin if I am.

With regards to being able to use <? in PHP script or not, that is purely a PHP Configuration Issue...not Apache.

In PHP, it is referred to by most as Short Tags. Different people have different opinions on using short tags. It really doesn't hurt anything to use short tags, but there are purist out there who like adhering to current standards and would rather not use anything that is considered deprecated.

In the PHP.INI file, locate the directive short_open_tag. If it is set to OFF, then that is why <? was not working.

As far as 'pushing out' raw PHP, I have seen this before. I cannot remember exactly what is was, but it was definitely a PHP Configuration Issue (might have been a missing opening tag issue - which react similiarly to what you are experiencing). Comb through your PHP.INI, and compare it to the last working PHP.INI file. It sounds like you should try turning on short tags. I might be wrong, but I'll take it on the chin if I am.

Let us know how it turns out.

Yes, you are right that when I change that line in php.ini taht fixes the problem. But the strange things is that I am using the same php.ini file as Iused with apache 2.0.55 and in apache 2.0.55 I didn't need to turn short tags on in php.ini. It doesn't reallly matter, since now that steffen and you have suggested turning short tags on in php.ini I did that and everything works fine. But I am confused about why the old configuration without turning short tags on in php.ini stil seemed to work. I'm guessing there was some other apache conf line that would have done the same thing...

...Are you running PHP Apache module that Steffen offers in downloads?
What version of PHP were you running with Apache 2.0.55? You never said....

Now that I am running apache 2.2, I am running the php apache module that steffen offers in downloads. But when I was running apache 2.0.55 I was running php 5.1.1 (and before that php 5.1.0 and before that successively earlier versions of php for the last two years....) with the regular php apache module that comes packaged with the regular php windows binary zip package.

pnllan wrote:

...In the past, was your PHP running as a CGI binary?

No. I've been using the regular windows binary zip package and not the cgi only version with an installer.

Well, I now know why I didn't need to turn on short tags in my php.ini file for my earlier setup with apache 2.0.55:

I have in my apache conf file the following line which should tell apache to execute php files rather than treating them as text files:
AddType application/x-httpd-php .php

That line worked fine for apache 2.0.55 but does not seem to do anything for apache 2.2. Maybe I need to tweak that line for apache 2.2? Or maybe there is some other change I made on my server when I upgraded to 2.2 that keeps that conf line from working right?

Hi - I know this post was from awhile back, but I had the same problem as you did regarding the php loading as text and not executing as an executable php file. My problem was that I was testing from the file directly (i.e. C:\webs\test\orderform.html) instead of using localhost (http://localhost/orderform.html). Once I changed the url to use localhost then the php file executed fine. Possibly not your solution but maybe it was late at night while you were testing