I have PHP running on WSL on windows along with nginx+php-fpm. The web component is running php OK, but console PHP produces opcode output for some reason. For example i have such PHP file:

?php echo "test OK\r\n";

When i run it as

php test.php

It will produce this output:

root@computer:/mnt/d/php/zona.sp# php test.php

$_main: ; (lines=2, args=0, vars=0, tmps=0) ; (after pass 1) ; /mnt/d/php/zona.space/test.php:1-3 L0 (2): ECHO string("test ok ") L1 (3): RETURN int(1)

$_main: ; (lines=2, args=0, vars=0, tmps=0) ; (after pass 2) ; /mnt/d/php/zona.space/test.php:1-3 L0 (2): ECHO string("test ok ") L1 (3): RETURN int(1)

$_main: ; (lines=2, args=0, vars=0, tmps=0, no_loops) ; (after pass 7) ; /mnt/d/php/zona.space/test.php:1-3 ; return [long] RANGE[1..1] L0 (2): ECHO string("test ok ") L1 (3): RETURN int(1) test ok

Why this happens?

root@computer:/mnt/d/php/zona.sp# php -v

PHP 7.2.9-1 (cli) (built: Aug 19 2018 06:56:13) ( NTS )

Copyright (c) 1997-2018 The PHP Group

Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

with Zend OPcache v7.2.9-1, Copyright (c) 1999-2018, by Zend Technologies


Somewhere in your PHP configuration, you have set opcache.opt_debug_level to a nonzero value. Remove this setting from your php.ini or the included ini file where it is set, or set it back to its default value of 0.

| improve this answer | |
  • Thank you! Did not mention this when install opcache. – Sergey Efimov Oct 17 '18 at 17:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.