How to override register_argc_argv in PHP?

前端 未结 2 1471
借酒劲吻你
借酒劲吻你 2021-01-18 06:26

I\'m using a shared host (fasthostingdirect) and for some reason they have this flag turned off by default. This means I\'m unable to access PHP command line parameters... u

2条回答
  •  半阙折子戏
    2021-01-18 07:16

    The ini_set('register_argc_argv', 1) does not work because by the time the code is executed, they have already been registered (or not).

    It seems you are able to run php directly, so copy your own php.ini file and pass it:

    php -c yourphp.ini
    

提交回复
热议问题