私はstackoverflowで新しく、Googleのクラウドとシンフォニーアプリのデプロイについていくつか質問があります。私はhttps://cloud.google.com/appengine/docs/php/symfony-hello-worldのドキュメントを読んだが、Hello Wordアプリケーションをデプロイすることができたが、私のsymfoyアプリケーションで試してみると、彼のエラーがある: XmlFileLoader.php行のInvalidArgumentException 259:ファイルを解析できない "(...)DependencyInjection/../Resources/config\web.xml "となります。 は私のapp.yamlでは、私はENV変数を設定します。 env_variables: GCS_BUCKET_NAME: "pinterpandaibucket" のcache_dir: "GS:// pinterpandaibucket/symfonyの/キャッシュ" LOG_DIR: "GS:// pinterpandaibucket/symfonyの/ログ" をGoogleアプリケーションエンジンにsymfonyアプリをデプロイ
<?php
public function __construct($environment = null, $debug = null)
{
// determine the environment/debug configuration based on whether or not this is running
// in App Engine's Dev App Server, or in production
if (is_null($debug)) {
$debug = !Environment::onAppEngine();
}
if (is_null($environment)) {
$environment = $debug ? 'dev' : 'prod';
}
parent::__construct($environment, $debug);
// Symfony console requires timezone to be set manually.
if (!ini_get('date.timezone')) {
date_default_timezone_set('UTC');
}
// Enable optimistic caching for GCS.
$options = ['gs' => ['enable_optimsitic_cache' => true]];
stream_context_set_default($options);
$this->gcsBucketName = getenv('GCS_BUCKET_NAME');
が...
public function getCacheDir()
{
if ($this->gcsBucketName) {
return getenv('CACHE_DIR');
}
return parent::getCacheDir();
}
public function getLogDir()
{
if ($this->gcsBucketName) {
return getenv('LOG_DIR');
}
return parent::getLogDir();
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
}
}
?>
ファイルシステムへの書き込み機能は、バケットにリダイレクトされます。そして、私はAppKernel.php関数をオーバーロードされます。私のアプリで何が修正されていないのか探してもらえますか? Googleのクラウドのドキュメントが最新でないため、このトピックが他の人に役立つことを願っています。事前にありがとう、申し訳ありませんが、私はフランス語のIT学生です。
オーギュ
ファイルシステムから静的ファイルを読み込めるので、これはGCSには関係していない可能性があります。アプリは/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/web.xmlを読み込もうとしているはずです。確認するには、完全なエラーメッセージを切り捨てられたバージョンの代わりに質問に含める必要があります。あなたのアプリケーションのこのファイルを、symfonyのスターターのものと比較できますか?あなたのアプリを作業スターターアプリから外したのか、それともApp Engine上で動作させるために何か違うことをしましたか? – Adam