3
I have a Linux server where php is configured with Nginx + fcgi.
The function fastcgi_finish_request works correctly as expected.
I have another machine with Windows 10, configured with apache + fcgi. The windows httpd.conf file has the following configuration snippet:
LoadModule fcgid_module modules/mod_fcgid.so
FcgidInitialEnv PATH "c:/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 64
FcgidConnectTimeout 16
FcgidMaxRequestsPerProcess 1000
FcgidMaxProcesses 50
FcgidMaxRequestLen 8131072
# Location php.ini:
FcgidInitialEnv PHPRC "c:/php"
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000
<Files ~ "\.php$>"
AddHandler fcgid-script .php
FcgidWrapper c:/php/php-cgi.exe .php
</Files>
On both machines all php scripts work correctly, with the exception of this function. In Windows I get a fatal error stating that the function does not exist.
Fatal error: Uncaught Error: Call to undefined function fastcgi_finish_request() in C:\www\teste.php:5 Stack trace: #0 {main} thrown in C:\www\teste.php on line 5
- The fastcgi_finish_request function exists in Windows?
- I need to enable something additional in php.ini?
Initial snippet of my phpinfo() on Windows 10:
PHP Version 7.1.0
System Windows NT NB67000 10.0 build 10586 (Windows 10) AMD64
Build Date Dec 2 2016 05:20:58
Compiler MSVC14 (Visual C++ 2015)
Architecture x64
Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--enable-debug-pack" "--with-pdo-oci=c:\php-sdk\oracle\x64\instantclient_12_1\sdk,shared" "--with-oci8-12c=c:\php-sdk\oracle\x64\instantclient_12_1\sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--without-analyzer" "--with-pgo"
Server API CGI/FastCGI
Virtual Directory Support enabled
Configuration File (php.ini) Path C:/Windows
Loaded Configuration File C:\php\php.ini
Scan this dir for additional .ini files (none)
Additional .ini files parsed (none)
PHP API 20160303
PHP Extension 20160303
Zend Extension 320160303
Zend Extension Build API320160303,TS,VC14
PHP Extension Build API20160303,TS,VC14
Debug Build no
Hello, see if it helps: http://stackoverflow.com/questions/23595092/fastcgi-finish-request-undefined
– Fernando Mertins
@Fernandomertins, had already seen this question. Unfortunately the user who answered did not mention which configuration was incorrect.
– jlHertel
Please send phpinfo() output start on Windows10 PC?
– Fernando Mertins
@Fernandomertins , I edited the question. See if this is enough or if you need more. If possible, please indicate which section you are interested in for analysis.
– jlHertel
Fatal mistake would be
undefined
?– Guilherme Nascimento
@Guilhermenascimento, yes, undefined functions when called cause a fatal error in the php engine.
– jlHertel
I know, is that sometimes the message says more important things, so always put the whole mistake, I always listen someone tell me something similar, but often the messages have something else that indicates something. In short it was only to confirm.
– Guilherme Nascimento
@Guilhermenascimento, I added the error message to leave you in no doubt.
– jlHertel
Your PHP is TS or NTS?
– Guilherme Nascimento
As you can see in phpinfo(), it is Thread Safe.
– jlHertel
From what I’m searching, this function will only exist if the Server API is as FPM/Fastcgi I found http://stackoverflow.com/a/12983778/1694568
– Fernando Mertins
One more to help: http://stackoverflow.com/questions/4539670/php-fpm-for-windows
– Fernando Mertins
@jlHertel I’m pretty sure that TS is used in apache2handler and NTS in Fast-cgi, try NTS. However I think the problem is that you downloaded a binary version and installed it, that is this function is not available in php-Fastcgi by default. The doc is a little vague, I’ll test when I get home
– Guilherme Nascimento
@Guilhermenascimento, tested by installing the NTS, and the error remains.
– jlHertel