0

I want install something which requires PHP AST extension. I followed the procedure found here at GitHub, but I cannot get it to actually work.

Now when I retry installing (pecl install ast) I get

pecl/ast is already installed and is the same as the released version 1.0.4 install failed

But when I check with php -m, ast is not listed there, and the plugin I want use also says

The php-ast extension must be loaded.... install ast and add extension=ast.so to your php.ini.

That's something which I have already done.

And so I am deadlocked and in need of help.

Ammar
  • 88
  • 1
  • 5
  • Maybe your cli php and apache php environments was different. Did you try create php.ini in your public_html directory and check your php.ini directories. Maybe your apache is using php-fpm. You should check your pool configuration. – Aaron Yordanyan Nov 27 '19 at 05:48
  • 1
    @Aaron Yordanyan, Thanks. Your comment helped me to check further and land on https://stackoverflow.com/questions/2750580/how-to-find-the-php-ini-file-used-by-the-command-line, which resolved the issue after I found the correct php.ini (It seems there are many, I don't know why they are there, though) – Ammar Nov 27 '19 at 06:21

1 Answers1

1

You probably have different php environment in cli and server.

Check your phpinfo and find php.ini path, then try to install(activate) extension for current environment (maybe you using php-fpm)

if you using php-fpm then you should configure your pool.

Aaron Yordanyan
  • 738
  • 7
  • 19