logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


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

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: Apache + mod_fcgid + PHP = (70008)Partial results
Author
daibach



Joined: 24 Apr 2007
Posts: 33
Location: Cardiff, Wales, UK

PostPosted: Thu 30 Jun '11 10:53    Post subject: Apache + mod_fcgid + PHP = (70008)Partial results Reply with quote

My life is currently being haunted, like I've been cursed by some old witch who I didn't hold a door open for or something.

Every time I try to get Apache 2.2 working with PHP via the mod_fcgid module, I get the following message when trying to start the service:

Code:
Wrapper C:/Apache2/php/php-cgi.exe cannot be accessed: (70008)Partial results are valid but processing is incomplete


I've checked permissions, they're fine but I've even tried opening them up fully to no avail. What makes this worse is that it's happened on several servers (all Windows) and my own local development environment. Also, I've had it working perfectly in the past, but all of a sudden it'd stop and never work again (usually after a server restart).

Scoured Google but I rarely find anything useful. My main suspects are Windows updates (would be great if anyone knows of one causing these problems) or McAfee interfering somehow (although httpd.exe and php-cgi.exe have been set as "excluded").

I've tried several versions of PHP (thread safe and non, 5.2.*, 5.3.*) and Apache (lounge and foundation versions).

Any ideas would be more than welcome Smile
Thanks!
Back to top
James Blond
Moderator


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

PostPosted: Fri 01 Jul '11 9:47    Post subject: Reply with quote

Can you run php-cgi.exe on the command line? Tried thread safe or non thread safe version? Tried to disabled all extensions in php.ini?

Anything in your windows event log related to this?
Back to top
daibach



Joined: 24 Apr 2007
Posts: 33
Location: Cardiff, Wales, UK

PostPosted: Fri 01 Jul '11 16:08    Post subject: Reply with quote

Just tried the following:
php-5.3.6-Win32-VC9.x86
php-5.3.6-nts-Win32-VC9.x86
php-5.2.17-Win32-vC6-x86
php-5.2.17-nts-Win32-VC6-x86

The php-cgi.exe from each of those fires up nicely from the command line without any issues. Everytime I tried from Apache, I get the same error as I mentioned previously.

Also confirmed that file permissions are fine, made them restrictive (deny) and received (720005) Access is denied. Checked that it's not something odd like the path being incorrect, purposely made the path wrong and get a (720002)The system cannot find the file specified.

Nothing is showing up in the Windows event log either.

Here's the configuration from Apache if that helps.

Code:
# ---[ Mod_FCGID ]---
LoadModule fcgid_module modules/mod_fcgid.so
AddHandler fcgid-script .php
FcgidInitialEnv PHPRC "C:/Apache2/php"
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000
FcgidInitialEnv PATH "C:/Apache2/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"
FcgidMaxRequestsPerProcess 1000
FcgidMaxProcesses 15
FcgidIOTimeout 120
FcgidIdleTimeout 120
FcgidWrapper "C:/Apache2/php/php-cgi.exe" .php
AddType application/x-httpd-php .php


Oddly, Zend Server CE works which is FastCGI as well (Zend Enabler)? Although that appears to be having it's own problems (eventually) that I won't go into Wink[/code]
Back to top
James Blond
Moderator


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

PostPosted: Fri 01 Jul '11 16:22    Post subject: Reply with quote

I think there is one issue

Code:

AddType application/x-httpd-php .php
is only needed if you use php as module, too (and load the module).
Back to top
daibach



Joined: 24 Apr 2007
Posts: 33
Location: Cardiff, Wales, UK

PostPosted: Fri 01 Jul '11 16:31    Post subject: Reply with quote

Good spot Smile

But still no luck Sad
Back to top
daibach



Joined: 24 Apr 2007
Posts: 33
Location: Cardiff, Wales, UK

PostPosted: Tue 26 Jul '11 13:18    Post subject: Reply with quote

!Solved!

Although I don't know enough about C++ and Apache modules to explain this or offer a permanent solution, so any help / insight would be greatly appreciated.

I went and downloaded Visual Studio C++ 2008, got hold of the mod_fcgid source and tried to hunt down the code creating the error. Turns out it's

Code:
    /* Does the wrapper exist? */
    if ((rv = apr_stat(&finfo, path, APR_FINFO_NORM,
                       cmd->temp_pool)) != APR_SUCCESS) {
        return missing_file_msg(cmd->pool, "Wrapper", path, rv);
    }


Which is in fcgid_conf.c, set_wrapper_config, line 801 of trunk @ revision 1139534.

If I comment out the "return" and build a release, throw it into my broken Apache PHP installation... it'll work! Smile I find this really odd that it's failing on startup with an error about accessing the php-cgi.exe file, but commenting out that line and it'll work fine and serve PHP correctly.

Any ideas?
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3049
Location: Hilversum, NL, EU

PostPosted: Tue 26 Jul '11 13:44    Post subject: Reply with quote

You fcgid config looks ok.

Did you try to disable all php modlues and verify if you still get the error ?

Also beware of FcgidMaxRequestLen,
see http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html#fcgidmaxrequestlen

To patch the code like this, is mostly not the way.

Steffen
Back to top
daibach



Joined: 24 Apr 2007
Posts: 33
Location: Cardiff, Wales, UK

PostPosted: Tue 26 Jul '11 14:15    Post subject: Reply with quote

I've made sure no PHP extensions were being loaded and still get the error with the unpatched mod_fcgid. Haven't used FcgidMaxRequestLen either.

What's strange is that if I take the Apache directory and put it on a Windows XP VM I have (The time-limited XP VM from Microsoft for testing with IE6), it'll work as expected. The same folder running on any of my servers or my local development machine, will fail with the "(70008)Partial Results" error. Have tried disabling the on-access McAfee Virusscan and that didn't make any difference.

I have found someone who had the same error but with mod_xsendfile instead....

http://www.calazan.com/apache-2-2-partial-results-are-valid-but-processing-is-incomplete-unable-to-stat-file-x-sendfile/

Their blog post appears to suggest that some OS file systems may not support certain operations properly and would always return APR_INCOMPLETE. The guy knows more than I do Wink
Back to top
daibach



Joined: 24 Apr 2007
Posts: 33
Location: Cardiff, Wales, UK

PostPosted: Tue 26 Jul '11 14:27    Post subject: Reply with quote

Have just confirmed that the following alteration to the code works. I based it on the mod_xsendfile changes I referenced in my previous reply.

Code:
    /* Does the wrapper exist? */
    if ((rv = apr_stat(&finfo, path, APR_FINFO_NORM,
                       cmd->temp_pool)) != APR_SUCCESS
      && (rv = apr_stat(&finfo, path, APR_FINFO_NORM,
                       cmd->temp_pool)) != APR_INCOMPLETE) {
        return missing_file_msg(cmd->pool, "Wrapper", path, rv);
    }


There is mention right at the bottom of this page about the API returning APR_INCOMPLETE if something is beyond the OS file system support.
http://dev.ariel-networks.com/apr/apr-tutorial/html/apr-tutorial-5.html
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3049
Location: Hilversum, NL, EU

PostPosted: Tue 26 Jul '11 14:32    Post subject: Reply with quote

Looks like you have some running that apr does not like. The VM is more a clean install.

Try to remove e.g. McAfee Virusscan and other suspucious software, seen more that disabling is not enough but remove did the trick.

Steffen
Back to top
daibach



Joined: 24 Apr 2007
Posts: 33
Location: Cardiff, Wales, UK

PostPosted: Tue 26 Jul '11 14:49    Post subject: Reply with quote

Apparently APR_FINFO_NORM is "an atomic unix apr_stat()".
Replacing this with APR_FINFO_TYPE (Type) works as expected

Code:
/* Does the wrapper exist? */
    if ((rv = apr_stat(&finfo, path, APR_FINFO_TYPE,
                       cmd->temp_pool)) != APR_SUCCESS) {
        return missing_file_msg(cmd->pool, "Wrapper", path, rv);
    }


Thanks for the suggestion, I'll see if I can get hold of a fresh installation before the virus scanner is installed. Although it may not help me much as they will not allow any Windows server to operate without the virus scanner.

I've found a few other mentions of APR_FINFO_NORM causing issues...
Someone suggesting similar problems
https://issues.apache.org/bugzilla/show_bug.cgi?id=50840

Subversion
http://svn.haxx.se/dev/archive-2001-12/0545.shtml

Bug about performance overhead with APR_FINFO_NORM mentioned and replaced with APR_FINFO_TYPE (mod_dav)
https://issues.apache.org/bugzilla/show_bug.cgi?id=45464

Another mention but this time from mod_python on how using it introduced issues on Windows XP.
http://www.modpython.org/pipermail/mod_python/2006-June/021331.html

...perhaps I should log something on the Apache bug tracker. What do you think?
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3049
Location: Hilversum, NL, EU

PostPosted: Tue 26 Jul '11 14:53    Post subject: Reply with quote

Always good to report you experience at the bugtracker. Maybe they know the ultimate answer.
Back to top
daibach



Joined: 24 Apr 2007
Posts: 33
Location: Cardiff, Wales, UK

PostPosted: Tue 26 Jul '11 14:57    Post subject: Reply with quote

Looks like someone else has had the exact same issue and the clever person has worked out the cause. Active Directory.

https://issues.apache.org/bugzilla/show_bug.cgi?id=51020

Apache has issues getting the full ACL information from Active Directory, especially from complex domains (which I'm certain mine is). That explains why I had it working a few years ago (simpler active directory), it working on the VM (not a domain member) and why it's affecting any server or machine I have tested it on.

Thanks for replying though Smile I'll probably add my experience to the bug. Plus hopefully anyone hitting the same issue might stumble across this topic Wink
Back to top
harry2



Joined: 26 Jul 2011
Posts: 1

PostPosted: Tue 26 Jul '11 15:37    Post subject: Reply with quote

Thanks you, for investigating. This helps us all.
Back to top
daibach



Joined: 24 Apr 2007
Posts: 33
Location: Cardiff, Wales, UK

PostPosted: Tue 26 Jul '11 15:41    Post subject: Reply with quote

No worries Wink

Just remember that if you're having the same problems, get on the Apache bug tracker and vote the bug up.

Solutions

  1. Recompile the mod_fcgid module with the patch referenced in the bug record (51020).[/*]
  2. Or, alter the permissions for php-cgi.exe (or whatever you're using with mod_fcgid), to only allow local users access. Changing this to SYSTEM (or whatever local user you're running the service as) will allow Apache to start without the need to query Active Directory.[/*]
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3049
Location: Hilversum, NL, EU

PostPosted: Tue 09 Aug '11 16:49    Post subject: Reply with quote

Updated version available as mod_fcgid-2.3.6a with that patch at https://issues.apache.org/bugzilla/show_bug.cgi?id=51020

Thanks!

Steffen
Back to top


Reply to topic   Topic: Apache + mod_fcgid + PHP = (70008)Partial results View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules