logoon  windows
Apache Lounge
Webmasters

 


About

Forum Index Downloads Search Forum Register Log in  RSS Apache Lounge


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

Apache Lounge is not sponsored by anyone.

Your donations will help to keep this site alive and well, and continuing the building of the binaries.




Windows Server 2003 SP2 / Apache / MySQL / PHP / FastCGI
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Apache Forum Index -> Apache third-party Modules



View previous topic :: View next topic  
Author Message
twosouth



Joined: 19 Feb 2010
Posts: 12

PostPosted: Mon 22 Feb '10 20:54    Post subject: Windows Server 2003 SP2 / Apache / MySQL / PHP / FastCGI Reply with quote

OK ... after 7 days of trying for 10+ hours a day, I'm still utterly screwed at setting up WAMP with FastCGI. I'm way past deadlines at this point, and the pressure is now unreal to produce a configuration that performs beyond the basic WAMP install (i.e. a la Wamp Server or XAMPP, etc.). I need help ... desperately. I'm specifically getting beat up on LodeRunner scans that tank after about 10 concurrent users (as opposed to excellent performance of the same app under Unix/Linux environments with no PHP accelerators or FastCGI).

No matter what I do, I always get to a point where running "httpd.exe -t" returns the following:
Quote:
Syntax error on line X of {path to httpd.conf file}: can't get fastcgi file info: {path to php-cgi.exe}({path to php-cgi.exe}), errno: 720997


So, to clarify some assumptions ... are these the exact tools I should be using to set up the "apachelounge-blessed" configuration that works for everyone?

1) Apache 2.2.14 from apachelounge.com
http://www.apachelounge.com/download/

2) Visual C++ 2008 Redistributable Package for running VC9-compiled code (?)
http://www.microsoft.com/downloads/details.aspx?FamilyID=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=en

3) PHP
Ultimately, I haven't found out what version I need here. If it's 5.1.x (as seems to be indicated on http://www.apachelounge.com/download/ ... see point 3a below), where would I get the compiled Windows binary for that? Here? http://php.net/releases/index.php Does it have to be non thread safe, too?

Can I not use v5.2.x or v5.3.x? Here are the ones I've tried thus far, without success:

PHP v5.3.12 VC9 NTS (non thread safe)
http://windows.php.net/downloads/releases/php-5.3.1-nts-Win32-VC9-x86.zip

PHP v5.3.12 VC9 TS (thread safe)
http://windows.php.net/downloads/releases/php-5.3.1-Win32-VC9-x86.zip

PHP v5.3.1 VC6 NTS
http://windows.php.net/downloads/releases/php-5.3.1-nts-Win32-VC6-x86.zip

PHP v5.3.1 VC6 TS
http://windows.php.net/downloads/releases/php-5.3.1-Win32-VC6-x86.zip

PHP v5.2.12 VC6 NTS
http://windows.php.net/downloads/releases/php-5.2.12-nts-Win32-VC6-x86.zip

PHP v5.2.12 VC6 TS
http://windows.php.net/downloads/releases/php-5.2.12-Win32-VC6-x86.zip

3a) "apachelounge-blessed" version of PHP module that'll work with the above version of Apache?
http://www.apachelounge.com/ the file php5apache2.dll-php5.1.x.zip described as apache2handler for "Apache 2.2.x and PHP 5.1.0-5.1.6" meaning, none of the current links to Windows binaries on php.net (above) are compatible? I'm confused ... is PHP v5.1.x even compatible with Apache v2.2.14?

4) FastCGI 2.3.5
http://www.apachelounge.com/download/

5) MySQL
http://www.mysql.com/downloads/mysql/
an afterthought, really, assuming you get all of the above working

What else am I missing?



I work as a PHP developer in knowledge management / technical training. If I had all the latest information/links provided to me, I would be happy to take the time to document in detail *exactly* what anyone would need as of February 22, 2010 in order to set up a working WAMP + FastCGI configuration and then post that documentation to the forum as a reference document. It's safe to assume that's going to be a highly sought-after document.

Thanks for your help,

tvg
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 4884
Location: Germany, Next to Hamburg

PostPosted: Tue 23 Feb '10 16:59    Post subject: Reply with quote

For the file info problem try this

Code:

DefaultInitEnv PATH "x:/xxxxx/php;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
DefaultInitEnv SystemRoot "C:/Windows"
DefaultInitEnv SystemDrive "C:"
DefaultInitEnv TEMP "C:/WINDOWS/Temp"
DefaultInitEnv TMP "C:/WINDOWS/Temp"
DefaultInitEnv windir "C:/WINDOWS"

Where xxxx points to you php dir.

to 2) You are right, without the runtimes files won't run on XP / Vista / 2003

to 3.1) If you only run php you have to take a thread safe version. Else apache will crash. Since the non thread safe version runs faster you should use it with fcgid.

to 3.2) VS6 vs. VC9 : The VC9 is the newer compiler. If you use a VC9 build apache like from apachelounge or apachehaus you should use the VC9 build for better performance.

to 3a) not more needed if you use latest php 5.3 or latest 5.2


For setting up apache see http://www.apachelounge.com/viewtopic.php?t=2394

setting up fcgid use the forum search, there are a lot of topic or see here
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 1635
Location: Sun Diego, CA, USofA

PostPosted: Tue 23 Feb '10 17:22    Post subject: Reply with quote

you mean FcgidInitialEnv? Wink
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 4884
Location: Germany, Next to Hamburg

PostPosted: Tue 23 Feb '10 17:24    Post subject: Reply with quote

glsmith wrote:
you mean FcgidInitialEnv? Wink


You got me, indeed! I shall use the new ones...
Back to top
twosouth



Joined: 19 Feb 2010
Posts: 12

PostPosted: Tue 23 Feb '10 18:18    Post subject: Reply with quote

@James Blond:

Thanks very much for the response. I'm not sure I understand the following:

Quote:
to 3.1) If you only run php you have to take a thread safe version. Else apache will crash. Since the non thread safe version runs faster you should use it with fcgid.


"only run php"? I'm going to use PHP, MySQL, and hopefully FastCGI (otherwise this thing just doesn't make the performance cut). So ... in that case, are you saying that I need to use a non thread safe PHP in order to work with FastCGI?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 4884
Location: Germany, Next to Hamburg

PostPosted: Tue 23 Feb '10 18:46    Post subject: Reply with quote

Whoops my mistake. I meant only want to run fcgid and not as module.
Back to top
twosouth



Joined: 19 Feb 2010
Posts: 12

PostPosted: Tue 23 Feb '10 18:53    Post subject: Reply with quote

OK ... I'm hitting a wall again on which version of PHP I should be using. I've got the Apache Lounge build of Apache v2.2.14 in place and configured correctly.

I'm intending to run PHP under mod_fcgid v2.3.5. Which PHP would you recommend?
    - Version?
    - NTS or TS?
    - VC6 or VC9?


Best,

tvg
Back to top
Millennium



Joined: 17 Apr 2006
Posts: 179
Location: Leiderdorp, NL, EU

PostPosted: Tue 23 Feb '10 22:04    Post subject: Reply with quote

twosouth wrote:
OK ... I'm hitting a wall again on which version of PHP I should be using. I've got the Apache Lounge build of Apache v2.2.14 in place and configured correctly.

I'm intending to run PHP under mod_fcgid v2.3.5. Which PHP would you recommend?
    - Version?
    - NTS or TS?
    - VC6 or VC9?


Best,

tvg


5.3.1
NTS
VC9
Back to top
twosouth



Joined: 19 Feb 2010
Posts: 12

PostPosted: Tue 23 Feb '10 23:21    Post subject: Reply with quote

I'm using PHP v5.3.1 NTS VC9. Here's what I'm getting now:

Quote:
Syntax error on line 32 of D:/apache/conf/extra/httpd-fcgid.conf:
Wrapper d:/php/php-cgi.exe cannot be accessed: (70008)Partial results are valid but processing is incomplete


mod_fcgid settings are as follows:

Code:
LoadModule fcgid_module modules/mod_fcgid.so

# Fast CGI module Settings (PHP)
#
<IfModule fcgid_module>
FcgidInitialEnv PATH "d:/php;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
FcgidInitialEnv SystemRoot "C:/Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:/WINDOWS/Temp"
FcgidInitialEnv TMP "C:/WINDOWS/Temp"
FcgidInitialEnv windir "C:/WINDOWS"

FcgidIOTimeout 40
FcgidConnectTimeout 10
FcgidMaxProcesses 8
FcgidOutputBufferSize 64
ProcessLifeTime 240
FcgidMaxRequestsPerProcess 500
FcgidMinProcessesPerClass 0

# Global Config Example
# Comment out next 4 lines to use per directory or per VirtualHost configuration
<Files ~ "\.php$>"
    AddHandler fcgid-script .php
    SetEnv PHPRC "d:/php"   
   FcgidWrapper "d:/php/php-cgi.exe" .php
</Files>

# Do not comment out below line
</IfModule>
Back to top
Millennium



Joined: 17 Apr 2006
Posts: 179
Location: Leiderdorp, NL, EU

PostPosted: Wed 24 Feb '10 0:02    Post subject: Reply with quote

Code:

<IfModule fcgid_module>
  #Set default Ini
  FcgidInitialEnv PHPRC "c:/php"
   
   
  <Directory "c:/apache/htdocs">
    FcgidWrapper "c:/php/php-cgi.exe" .php
    Options +ExecCGI
  </Directory>
   
  <IfModule mime_module>
    AddType text/html .php
    AddHandler fcgid-script .php
  </IfModule>
</IfModule>


works for me. Think "Options +ExecCGI" is important
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 1635
Location: Sun Diego, CA, USofA

PostPosted: Wed 24 Feb '10 0:09    Post subject: Reply with quote

I've seen that error before. In that particular case it was AVG locking the process before the module got fully loaded. Just looked at that email ... exactly the same except for the line number in the config

Last edited by glsmith on Wed 24 Feb '10 1:52; edited 2 times in total
Back to top
twosouth



Joined: 19 Feb 2010
Posts: 12

PostPosted: Wed 24 Feb '10 0:09    Post subject: Reply with quote

Thanks for that, Millennium.

I just tried your code verbatim, and I got the same result:

Quote:
Syntax error on line 7 of D:/apache/conf/extra/httpd-fcgid.conf:
Wrapper d:/php/php-cgi.exe cannot be accessed: (70008)Partial results are valid but processing is incomplete


When I run a net helpmsg 8 I get:

Quote:
Not enough storage is available to process this command.


Not much in Google about that, certainly not with reference to fcgi.
Back to top
twosouth



Joined: 19 Feb 2010
Posts: 12

PostPosted: Wed 24 Feb '10 0:49    Post subject: Reply with quote

@glsmith:

Quote:
I've seen that error before. In that particular case it was AVG locking the process before the module got fully loaded.


I've wondered if the McAfee install on this box is fussing with php-cgi.exe (or other executables). Thing is, I don't have rights to tell McAfee to lay off that particular .exe.

I'll get with the box admin and see what he can do.

Thanks!

tvg
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 1635
Location: Sun Diego, CA, USofA

PostPosted: Wed 24 Feb '10 2:09    Post subject: Reply with quote

@2S ... the results after the brainstorming were as follows

Quote:
When I deactivate my AVG I can start apache. When apache is started I can reactivate my AVG and everything is fine again.
...
I added an exception for httpd.exe and mod_fcgid.so. Now
it works again.
Back to top
wm003



Joined: 24 Mar 2006
Posts: 83

PostPosted: Wed 24 Feb '10 13:46    Post subject: Reply with quote

This config runs well for me.

Only 1 difference: i need to use the PHP 5.3.1 VC9 TS (not NTS) Version to make it work.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 4884
Location: Germany, Next to Hamburg

PostPosted: Wed 24 Feb '10 14:28    Post subject: Reply with quote

Quote:
When I deactivate my AVG I can start apache. When apache is started I can reactivate my AVG and everything is fine again.
...
I added an exception for httpd.exe and mod_fcgid.so. Now
it works again.


I tried a bit with the AVG settings. With the thread safe version I don't have to use the expections.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 1635
Location: Sun Diego, CA, USofA

PostPosted: Wed 24 Feb '10 16:58    Post subject: Reply with quote

ok James ... so it is narrowed down to NTS versions ... how about VC9 5.2.12 NTS? Is this also problematic that you know of? I'll assume wm003's problem with NTS is cause of the same thing.
Back to top
twosouth



Joined: 19 Feb 2010
Posts: 12

PostPosted: Wed 24 Feb '10 17:46    Post subject: Reply with quote

I just tried with PHP v5.3.1 VC9 thread safe. Same error 70008. I'd try glsmith's suggestion of v5.2.12 VC9 NTS, but I'm unaware of where to get that.

http://windows.php.net/download/
http://php.net/releases/index.php

In the interim, I'm still exploring the possibility of getting some anti-virus exceptions added. And I'll try with maybe some other versions of PHP, just in case. So far, however, I don't get any version of php-cgi.exe recognized under FastCGI.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 4884
Location: Germany, Next to Hamburg

PostPosted: Wed 24 Feb '10 17:51    Post subject: Reply with quote

There is no VS9 build of 5.2.x. VC9 is used only for 5.3.x and newer.
I made a quick try with 5.2.13RC2 NTS VC6 (without php.ini) on my XP no startup problems. But I have to tell that not all startups with the VC9 NTS version failed and only with the active AVG. So I'm not 100% sure if that is the issue or related to other things.
However, even if you can use "only" the thread safe version php won't blow the apache memory and won't crash apache by any php extension which I had before sometimes.

I quick benchmark with ab.exe and phpinfo() showed me that up tp 10.000 requests it worked with MaxProcessCount 8. Than I tried 100.000 and there weren't enough processes to handle all the requests. OK that is not a real world scenario. ab.exe runs on the same machine also a lot of other programs run in the background I won't run on a server.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 1635
Location: Sun Diego, CA, USofA

PostPosted: Wed 24 Feb '10 17:52    Post subject: Reply with quote

I guess it's now 5.2.13 .... tho I do not see any official announcement of that version over on php.net
Back to top


Post new topic   Reply to topic    Apache Forum Index -> Apache third-party Modules Goto page 1, 2  Next
Page 1 of 2