Reputation: 11839
How to compile/load custom php-extensions in Google App Engine, for example: OAuth, Gmagick ?
Upvotes: 1
Views: 540
Reputation: 1
https://cloud.google.com/appengine/docs/php/runtime#PHP_Pure_PHP
App Engine does not allow you to upload your own C extensions.
Google Cloud Shell console is not service machine.
Upvotes: 0
Reputation: 11839
Activate Google Cloud Shell (terminal icon in right top corner) in app dashboard
This guide based on Debian virtual machine
Detect distributive name
$ cat /etc/*-release
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support/"
BUG_REPORT_URL="https://bugs.debian.org/"
Swith to root
$ sudo su
Install pear
# apt install php-pear php5-dev
Install required extension, oauth, for example
# pecl install oauth
Add extension in .ini file for web and cli
# echo "extension=oauth.so" > /etc/php5/mods-available/oauth.ini
# ln -s ../../mods-available/oauth.ini /etc/php5/cli/conf.d/oauth.ini
Check if extension loaded
$ php -m | grep OAuth
Upvotes: 1