Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

The zephir parser extension could not be found or compiled!

Hi, i have installed zephir according docs at: https://docs.zephir-lang.com/en/latest/install.html

And test result is seemed right:

 _____              __    _
/__  /  ___  ____  / /_  (_)____
  / /  / _ \/ __ \/ __ \/ / ___/
 / /__/  __/ /_/ / / / / / /
/____/\___/ .___/_/ /_/_/_/
         /_/

Zephir version PHP Notice:  Undefined variable: xversion in /root/zephir/Library/Compiler.php on line 699
PHP Warning:  exec() has been disabled for security reasons in /root/zephir/Library/Compiler.php on line 699
0.9.4a-dev

...

But i got errors when i tried to build utils case:

[[email protected] utils]# zephir build
PHP Notice:  Undefined variable: xversion in /root/zephir/Library/Compiler.php on line 699
PHP Warning:  exec() has been disabled for security reasons in /root/zephir/Library/Compiler.php on line 699
zephir_parser extension not loaded, compiling it
PHP Warning:  shell_exec() has been disabled for security reasons in /root/zephir/Library/Compiler.php on line 264
PHP Notice:  Undefined variable: output in /root/zephir/Library/Compiler.php on line 265
PHP Notice:  Undefined variable: exit in /root/zephir/Library/Compiler.php on line 265
PHP Warning:  exec() has been disabled for security reasons in /root/zephir/Library/Compiler.php on line 265
Preparing for parser compilation...
PHP Notice:  Undefined variable: output in /root/zephir/Library/Compiler.php on line 267
PHP Notice:  Undefined variable: exit in /root/zephir/Library/Compiler.php on line 267
PHP Warning:  exec() has been disabled for security reasons in /root/zephir/Library/Compiler.php on line 267
PHP Warning:  exec() has been disabled for security reasons in /root/zephir/Library/Compiler.php on line 269
Compiling the parser...
PHP Notice:  Undefined variable: output in /root/zephir/Library/Compiler.php on line 274
PHP Notice:  Undefined variable: exit in /root/zephir/Library/Compiler.php on line 276
PHP Warning:  exec() has been disabled for security reasons in /root/zephir/Library/Compiler.php on line 276
PHP Warning:  file_get_contents(compile-errors.log): failed to open stream: No such file or directory in /root/zephir/Library/Compiler.php on line 278

PHP Warning:  file_get_contents(compile.log): failed to open stream: No such file or directory in /root/zephir/Library/Compiler.php on line 279

PHP Warning:  copy(modules/zephir_parser.so): failed to open stream: No such file or directory in /root/zephir/Library/Compiler.php on line 280
Zephir\Exception: The zephir parser extension could not be found or compiled!

Does any know how to fix this problem?

Thanks.



1.0k
Accepted
answer

Warning: exec() has been disabled for security reasons

Zephir requires exec() PHP's function enabled to run commands in the host OS, as it's disabled it can't compile extensions