duan7664 2016-08-29 19:31
浏览 56
已采纳

什么php.ini文件使用symfony服务器:运行命令?

I'm using virtphp to have separate environments (different PHP versions, extensions, etc).

When I use symfony's command to run a local development server:

php app/console server:run

It seems that it ignores the php.ini file of my virtual environment (~/.virtenv/envs/myenv/etc/php.ini), e.g.: does not load the extensions definided in that file.

But when I use the php built-in server directly, it works perfectly:

php -S 127.0.0.1:8000 --docroot=web/

What's the difference of those two commands or what does symfony do differently?

This is the output of the php --ini command:

Configuration File (php.ini) Path: /usr/local/etc/php/5.5
Loaded Configuration File:         /Users/mjuarez/.virtphp/envs/wowfi/etc/php.ini
Scan for additional .ini files in: /Users/mjuarez/.virtphp/envs/wowfi/etc/php
Additional .ini files parsed:      (none)

This is the output of the function phpinfo() in a Symfony controller when using the command php app/console server:run:

Configuration File (php.ini) Path   /usr/local/etc/php/5.5
Loaded Configuration File   /usr/local/etc/php/5.5/php.ini
Scan this dir for additional .ini files /Users/mjuarez/.virtphp/envs/wowfi/etc/php
Additional .ini files parsed    (none)

Note the difference in "Loaded Configuration File"... when I use the php --ini command it replaces the "Loaded Configuration file" with the one in my php virtual environment and when I use the command php app/console server:run it uses the "global" configuration file.

  • 写回答

3条回答 默认 最新

  • douji5397 2016-09-02 03:09
    关注

    A workaround for this issue is to move the php.ini file of my virtual environment to a sub-directory called php inside the etc directory. e.g.:

    Move the file ~/.virtphp/envs/my-env/etc/php.ini

    To ~/.virtphp/envs/my-env/etc/php/php.ini

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog