php.ini - command line PHP and WAMP server access different files

流过昼夜 提交于 2019-11-28 11:51:26

Everything you have mentioned is expected behavior. Apache has it's own php.ini version it uses, and require an Apache restart to make any changes effective.

CLI will also have it's own php.ini.

I just got mine fixed by following steps:

  1. Downloaded extensions according to my php version(7.2)
  2. Checked the PHP Extension Build API20170718,TS, VC15( so picked the file with ts in name)
  3. Added the files in C:\wamp64\bin\php\php7.2.10\ext
  4. Added extensions in C:\wamp64\bin\php\php7.2.10\php.ini
  5. Added extensions in loaded appache ini file too:Loaded Configuration File C:\wamp64\bin\apache\apache2.4.35\bin\php.ini
  6. Hit save.
  7. Exit Wammp and run again
  8. Hit php -m in cmd ------------------Boom-----------------------

It is common practice to have separate php.ini for cli, cgi ...

As for different environment you might want to use different setups, load different modules.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!