1

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/moldedjelly/craft-gae

  • So it just can't resolve that file/class? Does it exist in craft/app/etc/i18n? – Brad Bell May 8 '15 at 17:17
  • 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 May 9 '15 at 11:55
  • echo __FILE__; or Craft::log(__FILE__, LogLevel::Info, true); if you want it to go to Craft's log files. – Brad Bell May 9 '15 at 13:45
  • 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 May 12 '15 at 11:59
  • 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 May 13 '15 at 5:42
2

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.

  • 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 Jun 10 '15 at 18:56
  • It's been an open issue for a while now there, see github.com/yiisoft/yii2/issues/953 – Bob Olde Hampsink Jun 11 '15 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.