Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6332077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:11:37+00:00 2026-05-24T18:11:37+00:00

I have very specific problem running PHP as Apache 2.2 module. When running PHP

  • 0

I have very specific problem running PHP as Apache 2.2 module. When running PHP as CGI, everything works OK, but slow. The output I get in this case is:

Good charset

But when runing PHP as Apache module on the same environment, I get the following output:

Wrong charset

The only difference is that I add following lines to appropriate VirtualHost in httpd.conf

SetEnv PHPRC "C:/PHP5/"
ScriptAlias /local-bin/ "C:/PHP5/"
AddHandler application/x-httpd-php5 php
Action application/x-httpd-php5 "/local-bin/php-cgi.exe"
<Directory "C:/PHP5/">
  Order allow,deny
  Allow from all
  <Files "php-cgi.exe">
    Allow from all
  </Files>
</Directory>

The website uses 2 databases – one MySQL and one MSSQL. The text which is displayed incorrectly is retrieved from MSSQL database. There aren’t any problems with text which is retrieved from MySQL database.
Any ideas how to run PHP as Apache module and get the same output as running PHP as CGI?

My setup is: Apache 2.2; PHP 5.2.17; mssql PHP extension 7.0; mbstring PHP extension 4.4.4

Headers in CGI mode, returned by curl -i

HTTP/1.1 200 OK
Date: Mon, 08 Aug 2011 11:56:15 GMT
Server: Apache/2.2.16 (Win32) mod_ssl/2.2.16 OpenSSL/0.9.8o
X-Powered-By: PHP/5.2.13
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: PHPSESSID=3h4kpps0l02pecfgktonq7rjd6; path=/
Transfer-Encoding: chunked
Content-Type: text/html

Headers in PHP as a module mode:

HTTP/1.1 200 OK
Date: Mon, 08 Aug 2011 12:04:16 GMT
Server: Apache/2.2.16 (Win32) mod_ssl/2.2.16 OpenSSL/0.9.8o PHP/5.2.13
X-Powered-By: PHP/5.2.13
Set-Cookie: PHPSESSID=hi9h3skbsjvpcr7usdlf36d2t7; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Transfer-Encoding: chunked
Content-Type: text/html
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T18:11:38+00:00Added an answer on May 24, 2026 at 6:11 pm

    I don’t know what was the exact problem, but everything seems to work OK now. I just downloaded fresh PHP package and configured it from scratch. What I didn’t mention is that I use ZendServer Community Edition and it seems to cause the problems (by the way with same PHP 5.2.17 version). When I configure virtual host to use my fresh PHP installation – everything works OK, but when I use ZendServer built in PHP it causes problems.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a very general question but it's based on a specific problem. I've
I have a very specific problem here. I have a multi-dimensional array that I
I have a very specific problem, and a work around solution will not help.
I have a very specific html table construct that seems to reveal a Gecko
I have a particular application that needs to calculate something very specific, and while
I have a very odd issue. When I execute a specific database stored procedure
We have very strange problem, one of our applications is continually querying server by
i have very simple problem. I need to create model, that represent element of
I have a very tough problem I can't solve. I have an app which
I have several different sites running off WordPress, and the URLs tend to get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.