dqq48152418 2014-05-23 22:19
浏览 28
已采纳

使用于PHP的App Engine加载BCMath或php.ini

I'm running the latest php-cgi from Arch Linux's repos. I enabled the BCMath module on php.ini and it works when I run php, php-cgi and php in Apache. However, when dev_appserver.py runs php, somehow it loses the configuration I set in php.ini. Causing both BCMath, soap and my locale settings to not load, causing:

dev_appserver.py --php_executable_path /usr/bin/php-cgi appengine-try-php
PHPEnvironmentError: The PHP runtime requires the "bccomp" function, which is not defined.

php-cgi -i | grep -i bcmath returns BCMATH enabled.

php -i | grep -i bcmath returns BCMATH enabled.

php -r "echo bccomp('1.0001', '1', 5);" returns 1.

Is there any way to make dev_appserver.py load the module or php.ini?

  • 写回答

2条回答 默认 最新

  • doutinghou6980 2014-05-23 23:57
    关注

    google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/php/runtime.py

    Supports loading a php.ini file from the project directory, as such you can just drop a php.ini file in the project directory. It will by default ignore the php.ini file in /etc/php/php.ini unlike all other instances of php. Here is the php.ini script I'm using. It likely has extra modules and modules that are missing compared to the production App Engine.

    date.timezone = America/New_York
    extension=bcmath.so
    extension=bz2.so
    extension=curl.so
    extension=gd.so
    extension=gettext.so
    extension=mcrypt.so
    extension=mysqli.so
    extension=mysql.so
    extension=openssl.so
    extension=pdo_mysql.so
    extension=soap.so
    extension=zip.so
    

    Happy Apping.

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

报告相同问题?

悬赏问题

  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效