Symfony on Google App Engine Troubleshooting Series: Part I

Warning: Only for apps that are seriously about scaling. Stop reading if you think you can plug any ugly Symfony code without changing your mindset :P.

I have taken a peek at GAE and its APIs and how restrictive they have made the sandboxing environment for PHP that they made it interesting. I think they have the right to do things like that since they want apps to scale only. I mean don’t take me wrong but after reading their documentation, things like disabled functions, ready-only file system, maximum times of execution, quotas, limitations and ignoring functions, changing the default behavior of PHP sensitive defaults, etc, it seems PHP is not like we used to know it. Some people have called it castrated PHP :P. The other downside is that some services that are currently existing in java or other runtimes do not yet appear available in PHP so we are forced to not use bigdata or other valuable services and are forced to pay for their SQL implementation which probably uses MySQL.

If your code is PHP like the helloworld then there is no problems and you end up testing it in the local SDK sandboxed environment and deploying it like a pro with their slow and pythonic cli uploader tools:

~ ./deploy                                    Luiss-MacBook-Pro-2 [12:40:44]
12:40 PM Application: devfest-cordoval; version: 1
12:40 PM Host:
12:40 PM
Starting update of app: devfest-cordoval, version: 1
12:40 PM Getting current resource limits.
Your browser has been opened to visit:
If your browser is on a different machine then exit and re-run this
application with the command-line parameter
Authentication successful.
12:41 PM Scanning files on local disk.
12:41 PM Cloning 1 static file.
12:41 PM Cloning 4 application files.
12:41 PM Uploading 2 files and blobs.
12:41 PM Uploaded 2 files and blobs
12:41 PM Compilation starting.
12:41 PM Compilation completed.
12:41 PM Starting deployment.
12:41 PM Checking if deployment succeeded.
12:41 PM Deployment successful.
12:41 PM Checking if updated app version is serving.
12:41 PM Completed update of app: devfest-cordoval, version: 1

Many frameworks even laravel or silex had been successfully deployed in GAE without problems. Yeah I am not even speaking of wordpress support which I think is totally flawed since some of the plugins assume write filesystem and probably will break things when plugged. I also don’t mention drupal :P, although friends with drupalers, I am sorry I can’t do it. Laravel needs an ugly patch and Silex, well Silex is easy just because probably does not cache or uses the filesystem for optimizations in templates, annotations, or doctrine generation, like Symfony does. Or in any case these generations are not absolute path dependent and are done offline.

In addition to this, it handicaps us who use fabric or capifony, or those who like to run assets on production or do some setups. Bye bye composer on the server by the way. I believe, unless I am wrong, that all files have to be committed since day one, even vendors. And I am not talking about git commits, I am talking about their pythonic deploying tool basically scanning our whole directory for migrating changes on upload.

All in all we are identifying the roadblocks for all of this, namely overloading some forbidden functions via an easy composer component and also PR’eing for FrameworkBundle to support caching directly on Memcache so to break absolute path dependencies on templates and other cache files.

Here is the PR

Also if I did not mention enough, be careful in plugging too many composer dependencies as you may hit the quota of number of files! Oh and the dev environment is failing uglily with a php bug on their SDK on some schema parsing problem. In `production` `dev` if that exists! thanks for forcing us to do this Google! it is working at least:

Screenshot 2013-11-11 10.32.10

More news soon!

Please support me via buying the Symfony2 Ecommerce book

Lord willing, I am attending Warsaw SymfonyCon and also SunshinePHP and really ask you to help me raise funds to continue getting involved in the community.

Encouragements in all good!

One thought on “Symfony on Google App Engine Troubleshooting Series: Part I

Leave a Reply

Your email address will not be published. Required fields are marked *