<p>I got the same error and started debugging with XDebug.</p>

<p>I've put some hours in this and my conclusion is: You can't run Craft on GAE. It gets worse: You can't even run Yii1 (the framework Craft was built on) on GAE. So that's where it stops.</p>

<p>I did manage to get Craft running on a GAE development server instance, but to do that I had to uncomment every filesystem check in both Craft and Yii (functions like is_dir(), etc). These functions don't even work with the gs:// wrapper.</p>

CC BY-SA 3.0
2015-06-10T18:56:29.377Z
I'd suspect Yii 2 is going to have the same issue, right?  So basically "you can't run any PHP app that uses file system methods on GAE"?
Brad Bell
CC BY-SA 3.0
2015-06-11T13:27:40.497Z
It's been an open issue for a while now there, see https://github.com/yiisoft/yii2/issues/953
Bob Olde Hampsink
CC BY-SA 3.0
2015-06-10T18:11:35.720Z
2015-06-10T18:11:35.720Z
Bob Olde Hampsink
<p>Have tried getting Craft working on Google App Engine (GAE) using the GAE SDK and after defining CRAFT_STORAGE_PATH first up in the index.php, setting it to a Google Cloud Storage path eg. gs://craft-gae-storage/ I found I had to uncomment the workings of craft_ensureFolderIsReadable function in bootstrap.php so it didn't fail on the folder checks, but then it still dies with the error:</p>

<p>Fatal error: Class 'Craft\PhpMessageSource' not found in /Users/.../Craft-gae-HappyLager/craft/app/framework/YiiBase.php on line 213</p>

<p>I'm using the HappyLager demo combined with the Yii GAE codebase from <a href="https://github.com/poul-kg/yii-app-engine" rel="nofollow">https://github.com/poul-kg/yii-app-engine</a> with a slightly modified base setup to try to get craft working:
<a href="https://github.com/moldedjelly/craft-gae" rel="nofollow">https://github.com/moldedjelly/craft-gae</a></p>

CC BY-SA 3.0
2015-05-08T17:17:59.010Z
So it just can't resolve that file/class? Does it exist in `craft/app/etc/i18n`?
Brad Bell
CC BY-SA 3.0
2015-05-09T11:55:50.033Z
Yep, PhpMessageSource.php exists in craft/app/etc/i18n.
Is there something I can put in a PHP file to output the paths to make sure they're being set correctly?
moldedjelly
CC BY-SA 3.0
2015-05-09T13:45:16.787Z
`echo __FILE__;` or `Craft::log(__FILE__, LogLevel::Info, true);` if you want it to go to Craft's log files.
Brad Bell
CC BY-SA 3.0
2015-05-12T11:59:56.030Z
Further investigating, the Craft class mappings are not being created... I've got the HappyLager demo site working fine on a standard LAMP stack and doing a print_r of the self::$classMap in YiiBase.php no probs:

    [CLogger] => /Users/.../CLogger.php
    [Craft\BaseAssetSourceType] => /.../BaseAssetSourceType.php
    [Craft\GoogleCloudAssetSourceType] => /.../GoogleCloudAssetSourceType.php
etc.

But trying to output the same from GAE, it only has mapped CLogger. There is something with the class import & autoload functions. It was returning false from the autoload function (line 436)
moldedjelly
CC BY-SA 3.0
2015-05-13T05:42:19.180Z
Another difference with the LAMP setup vs. GAE: I put an echo in getComponent and can see that the LAMP setup does getComp. for these classes in order: Craft\CacheService, Craft\ConfigService, Craft\PathService, Craft\HttpRequestService etc. whereas GAE with the same tries to get only the 1 component Craft\PhpMessageSource - then it halts on the error in the original question... Does this difference in the loading (or not loading) of the classes help to indicate what's going wrong?
moldedjelly
CC BY-SA 3.0
2015-05-13T14:28:08.330Z
That's really strange.  I can't think of any reason why autoloading would be broken on GAE other than maybe files are missing from the `craft/app` folder?
Brad Bell
CC BY-SA 3.0
2015-05-14T07:04:11.040Z
Have done a clean copy of craft/app to the LAMP and GAE setup and both have the same file count (4,546) and tested the LAMP again - working, GAE - not working with same error as above. After further trying to track down the issue... putting a simple echo in craft/app/Craft.php _importFile function - the echo outputs as expected in LAMP, but not at all in GAE... leading me to think that the Craft class that is extending Yii is not being touched ... instead it's running the base Yii only hence why it's failing to import the Craft namespaced classes?
moldedjelly
CC BY-SA 3.0
2015-05-14T16:00:18.173Z
I'm stumped... I've got 0 experience with GAE.
Brad Bell
<filecache><hosting>
Craft hosted on Google App Engine - failing to load Craft classes?
# Craft hosted on Google App Engine - failing to load Craft classes?

(Asked by: username_0 on 2015-05-08)

Have tried getting Craft working on Google App Engine (GAE) using the GAE SDK and after defining CRAFT\_STORAGE\_PATH first up in the index.php, setting it to a Google Cloud Storage path eg. gs://craft-gae-storage/ I found I had to uncomment the workings of craft\_ensureFolderIsReadable function in bootstrap.php so it didn't fail on the folder checks, but then it still dies with the error:

Fatal error: Class 'Craft\PhpMessageSource' not found in /Users/.../Craft-gae-HappyLager/craft/app/framework/YiiBase.php on line 213

I'm using the HappyLager demo combined with the Yii GAE codebase from <https://github.com/poul-kg/yii-app-engine> with a slightly modified base setup to try to get craft working:
<https://github.com/username_0/craft-gae>

**Tags:** filecache, hosting

> **Comments:**
> **username_1**: So it just can't resolve that file/class? Does it exist in `craft/app/etc/i18n`?  
> **username_0**: Yep, PhpMessageSource.php exists in craft/app/etc/i18n. Is there something I can put in a PHP file to output the paths to make sure they're being set correctly?  
> **username_1**: `echo __FILE__;` or `Craft::log(__FILE__, LogLevel::Info, true);` if you want it to go to Craft's log files.  
> **username_0**: Further investigating, the Craft class mappings are not being created... I've got the HappyLager demo site working fine on a standard LAMP stack and doing a print_r of the self::$classMap in YiiBase.php no probs:      [CLogger] => /Users/.../CLogger.php     [Craft\BaseAssetSourceType] => /.../BaseAssetSourceType.php     [Craft\GoogleCloudAssetSourceType] => /.../GoogleCloudAssetSourceType.php etc.  But trying to output the same from GAE, it only has mapped CLogger. There is something with the class import & autoload functions. It was returning false from the autoload function (line 436)  
> **username_0**: Another difference with the LAMP setup vs. GAE: I put an echo in getComponent and can see that the LAMP setup does getComp. for these classes in order: Craft\CacheService, Craft\ConfigService, Craft\PathService, Craft\HttpRequestService etc. whereas GAE with the same tries to get only the 1 component Craft\PhpMessageSource - then it halts on the error in the original question... Does this difference in the loading (or not loading) of the classes help to indicate what's going wrong?  
> **username_1**: That's really strange.  I can't think of any reason why autoloading would be broken on GAE other than maybe files are missing from the `craft/app` folder?  
> **username_0**: Have done a clean copy of craft/app to the LAMP and GAE setup and both have the same file count (4,546) and tested the LAMP again - working, GAE - not working with same error as above. After further trying to track down the issue... putting a simple echo in craft/app/Craft.php _importFile function - the echo outputs as expected in LAMP, but not at all in GAE... leading me to think that the Craft class that is extending Yii is not being touched ... instead it's running the base Yii only hence why it's failing to import the Craft namespaced classes?  
> **username_1**: I'm stumped... I've got 0 experience with GAE.  

---

## 1 answers

### Answer by username_2 on 2015-06-10. Score: 3

I got the same error and started debugging with XDebug.

I've put some hours in this and my conclusion is: You can't run Craft on GAE. It gets worse: You can't even run Yii1 (the framework Craft was built on) on GAE. So that's where it stops.

I did manage to get Craft running on a GAE development server instance, but to do that I had to uncomment every filesystem check in both Craft and Yii (functions like is\_dir(), etc). These functions don't even work with the gs:// wrapper.

> **Comments:**
> **username_1**: I'd suspect Yii 2 is going to have the same issue, right?  So basically "you can't run any PHP app that uses file system methods on GAE"?  
> **username_2**: It's been an open issue for a while now there, see https://github.com/yiisoft/yii2/issues/953  

---

