0

Tried to follow App Engine Standard's guide, but the App Engine PHP Development Plugin installation instructions only show how to compile it, when it seems that protobuf headers already come with fedora's official repos.

Has anyone installed the App Engine PHP environment the Fedora way?

Ray Foss
  • 3,649
  • 3
  • 30
  • 31

1 Answers1

0

Tl;Dr; Your options are dire. You must either build in a chroot or make your own container.

There is a prebuilt docker with some major bugs here: https://stackoverflow.com/a/38415948/370238

I may try to build this in yum strap and see how it goes.


You can't. not only do you need a bunch of conflicting dependencies, but the app engine php extension is made with static paths, meaning you'll have to nuke your php and bison to make this work. And thats without other php-extensions that are supported by app engine. The right way to do this is to do everything in a chroot... but now we are describing docker, and someone already made a docker image for this here: https://stackoverflow.com/a/38415948/370238


THESE INSTRUCTIONS ARE A DEAD END:

For starters, this is not easy. You'll need to build php from source, then build the PHP extension from source. Luckly, the protobuf-devel in the official repo works just fine.

Ubuntu people are having similar issues. Google App Engine PHP SDK - How to install on Ubuntu (15.10)?

Battle #1 Bison 2.6.5

Disclaimer: These instructions make incompatible changes to Fedora 24. You may have upgrade errors or incompatibilities. Please leave a comment if you have a better suggestion, such as a chroot approach.

You'll need bison 2.6.5, as fedora comes with 3 which is not able to be used in building PHP-5.5. Just read the INSTALL file the the code from http://ftp.gnu.org/gnu/bison/

Battle #2 PHP 5.5

Fedora 24 comes with PHP 5.6, which will at this time is completely incompatible with the appengine-php-extension. This will take a while.

git clone https://github.com/php/php-src.git

Battle #3 App Engine PHP Runtime Extension

  1. Install Google's Protocol Buffer headers with sudo dnf install protobuf-devel as we will be compiling the PHP Runtime Extension with parts of protobuf built in.
  2. Clone the App Engine PHP Extension repository, I suggest into /opt. git clone git@github.com:GoogleCloudPlatform/appengine-php-extension.git
  3. Cd into it and generate the C++ source and header files for remote_api.proto and urlfetch_service.proto

This two commands should do it, and have no output.

 protoc --cpp_out=. remote_api.proto
 protoc --cpp_out=. urlfetch_service.proto
  1. Youll still need the C++ buildtools Google uses make sure you have them with sudo dnf install autoconf automake libtool curl make gcc-c++ unzip libxml2-devel
  2. the lib path for protobuf is /usr/lib64 the include path is /usr/include. You can find this by running sudo dnf repoquery -l protobuf-devel

Note that App Engine is as of this writing, using PHP 5.5.34, while Fedora 24 is using 5.6.23... so don't use array constants if you plan to launch on App Engine.

end of story: to make this work youll need to manually overlay all aspects of php55 into fedora 24 and compile every extension supported by app engine. By doing so you'll completely cripple the repo packages that depend on php. don't do it.

Community
  • 1
  • 1
Ray Foss
  • 3,649
  • 3
  • 30
  • 31