Code Monkey home page Code Monkey logo

Comments (14)

alphp avatar alphp commented on June 15, 2024

I checked both the February release
https://github.com/win32service/win32service/releases/tag/v0.4.0
as the last build with PHP-7.3.6-TS-x64.
I also tried the official binary downloaded from https://windows.php.net/downloads/pecl/releases/win32service/
None of the binaries has given problems.
Can you give more information about your environment?

from win32service.

ASchmidt1 avatar ASchmidt1 commented on June 15, 2024

I accidentally stumbled across that as I was working on an OPcache bug, which required me to test development builds and release candidates. Despite OPcache, Wincache, and xDebug disabled, phpinfo(8) will fail. But, it will work if all extensions are active, EXCEPT win32service.

I'm using the 2019-02-20 build:
https://pecl.php.net/package/win32service/0.4.0/windows
which works fine with previous 7.3 and 7.2 versions.

But it DOES fail with the 7.3.7-RC3:
https://windows.php.net/qa/#php-7.3
per example, and had as well with a development build of 7.2.21-dev.

PS - to be clear, my PHP service that uses your extension continues to function just fine in each case. The problem is ONLY the phpinfo(8).

from win32service.

alphp avatar alphp commented on June 15, 2024

With PHP-7.3.7RC3-TS-x64 crash wen phpinfo () is invoked.
Attached test script.
win32service-crash.zip

from win32service.

macintoshplus avatar macintoshplus commented on June 15, 2024

Hi,

Thanks for your feedback. To search the solution, can you send me the PHP output when it crashes ?

from win32service.

ASchmidt1 avatar ASchmidt1 commented on June 15, 2024

I forgot to mention before - running phpinfo() from the php-cli command line does NOT cause problems. It only crashes when running FCGI (php-cgi).

First I fixed the test script, so that the php.exe and php.ini could be located in the "Program Files" folder (embedded space in path):

<?php
	$php = PHP_BINARY;
	$ini = '"'.php_ini_loaded_file().'"';
	$iniopt = $ini ? "-c $ini" : '';
	$iniopt .= extension_loaded('win32service') ? '' : ' -d extension=php_win32service.dll';
	$command = "\"$php\" $iniopt -r \"phpinfo();\"";
	exec($command, $output, $status);
	var_dump($output, $status);

Then I ran your script on the command line - result is file "clioutput.txt".
clioutput.txt

No idea what your test script is attempting, but just in case here "phpinfo.cli.txt", which is the command line output of phpinfo().
phpinfo.cli.txt

However HERE are the RELEVANT files that are the CAUSE of the php-cgi crash. I ran phpinfo() using php-cgi.exe, first with win32service ACTIVE, and then with win32service removed. Please note the garbled HTTP header when win32service is ACTIVE:

phpinfo.cgi.html.txt
phpinfo.disabled.cgi.html.txt
phpinfo.cgi.html.zip

from win32service.

ASchmidt1 avatar ASchmidt1 commented on June 15, 2024

Hi,
Thanks for your feedback. To search the solution, can you send me the PHP output when it crashes ?

Here the side by side of the php-cgi.exe output. Notice the garbled "Content-Type" header in line 2 when win32service extension is loaded.
inactive-vs-loaded

from win32service.

macintoshplus avatar macintoshplus commented on June 15, 2024

Result of my test in command line:

PHP version Result for TS result for NTS
PHP 7.2.20RC3 ✔️ ✔️
PHP 7.3.7RC3 ✔️ ✔️

Result with IIS:

PHP x64 version Result for TS result for NTS
PHP 7.3.6 🚫 ✔️
PHP 7.3.7RC3 🚫 ✖️
PHP 7.2.20RC3 🚫 ✖️
PHP 7.2 snapshot 🚫 ✖️

from win32service.

macintoshplus avatar macintoshplus commented on June 15, 2024

Ok, what is your web server ? IIS ? Apache ?

The PHP build is: TS or NTS ?

from win32service.

ASchmidt1 avatar ASchmidt1 commented on June 15, 2024

Hi, IIS, NTS. However, I'm now able to produce the problem without using IIS. Opening a command window, I can use:
php-cgi -i >output.txt
and it will produce an INTACT content-header, even if win32service is active.

However, running:
php-cgi phpinfo.php >output2.txt
phpinfo.php.txt
will produce the garbled content-header.

So this completely rules out IIS or similar environmental factors. This is now plain-vanilla php-cgi.exe.

from win32service.

macintoshplus avatar macintoshplus commented on June 15, 2024

Hi,

Can you try with this build and send me the phpinfo html page ?

from win32service.

ASchmidt1 avatar ASchmidt1 commented on June 15, 2024

fixed.html.txt
Looks okay now: correct Content-Type header if running php-cgi in command line, and also if running from IIS.

from win32service.

macintoshplus avatar macintoshplus commented on June 15, 2024

okay, the problem come from the PHP version check. This check is necessary only for PHP 7.0.0 and 7.1.0.
I remove it.

The problem is only from the RC version or the snapshot.

from win32service.

macintoshplus avatar macintoshplus commented on June 15, 2024

Preview:
image

image

You can download the version 0.4.1 from the artifact of AppVeyor at the end of build.

from win32service.

ASchmidt1 avatar ASchmidt1 commented on June 15, 2024

Thanks, 0.4.1 downloaded, rebooted, and PHP 7.3.7 phpinfo() working under IIS.

from win32service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.