0

我有一个错误。在应用程序根目录中使用我的“php.ini”。如下...

[php.ini]

html_errors = "Off"
display_errors = "Off"
error_reporting = E_ALL ^ E_WARNING ^ E_NOTICE
auto_prepend_file = "configure.php"

[错误]

ERROR    2014-08-25 03:20:57,158 php_runtime.py:226] The PHP runtime is not available
Traceback (most recent call last):
  File "/home/foo/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 222, in new_instance
    self._runtime_config_getter().application_root)
  File "/home/foo/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 195, in _check_environment
    raise _PHPEnvironmentError(check_process_stdout)
_PHPEnvironmentError

在使用未自定义的 php_runtime.py 期间我会收到此错误。当我编辑此行时,此错误无关紧要。

[原来的]

186     args = [php_executable_path, '-c', application_root, '-f',
187             _CHECK_ENVIRONMENT_SCRIPT_PATH]

[定制]

186     args = [php_executable_path, '-f',
187             _CHECK_ENVIRONMENT_SCRIPT_PATH]

(“-c 选项”被禁用)

我的 php 选项“auto_prepend_file”是谋杀。但我没有任何想法。我需要“auto_prepend_file”进行自动加载,而无需将包含 init 文件放在每个源文件的开头。

4

1 回答 1

1

Editing the php_runtime.py file is not recommended, the -c option is the path to a directory to read the php.ini file from, which App Engine probably sets to your applications directory.

By removing it your error is going away because the development server is most likely no longer reading your php.ini file, but using defaults.

I have tried using auto_prepend_file myself, and I cannot get it to work either. This looks like a bug in App Engine itself. There does not appear to be any existing issues about it logged on the App Engine bug tracker, you should go and log one yourself.

于 2014-08-25T09:52:50.583 回答