Is it possible to load an extension from PHP cli interface, without modify the ini file?

后端 未结 3 1416
栀梦
栀梦 2021-02-04 07:25

I checked man php and output of php -h, but I didn\'t seem to find such thing.

But I remember seeing it somewhere, you could do something like

3条回答
  •  再見小時候
    2021-02-04 07:42

    To disable all by default (by ignoring php.ini) and specify specific PHP extensions, try:

    php -n $(for e in curl ctype json iconv; { echo -dextension=$e.so; } | xargs) -m
    

    To run the script, change -m into file name.

提交回复
热议问题