Skip to content

Symfony ClassLoader fails on Google App Engine #20241

Closed
@bwegrzyn

Description

@bwegrzyn

Symfony dies with the following error:

PHP Fatal error: Fail to create and change permission of temporary file vfs://root/temp///classes.php58056703cad0a0.47844542 in /base/data/home/runtimes/php/sdk/google/appengine/runtime/SplOverride.php on line 178

The class loader component uses realpath() which is not supported on Google App Engine. Additionally, realpath does not support stream wrappers, which are necessary to get Symfony working on GAE.

The cache dir for GAE Symfony installations is something along the lines of gs://bucketname/var/cache, but this gets completely erased when run through realpath() (which is why the extra slashes appear in the path to classes.php).

After debugging, the error appears to be caused by line 62 of CollectionClassLoader. Commenting this line out makes Symfony work on GAE, but obviously isn't the right solution here.

$cacheDir = rtrim(realpath($cacheDir), '/'.DIRECTORY_SEPARATOR);

I suppose the proper solution here would be to make the ClassLoader component work properly with stream wrappers.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions