Bachelor Tech
  • Home
  • Tutorials
  • Portfolio
  • About Jan
  • Contact Jan

Install Composer + Google API Client (Linux)

by Jan Bachelor March 16, 2021

I assume that your web server is running PHP on Linux – in this guide, we will cover both Debian/Ubuntu as well as CentOS distros. What we will need to do is to install Composer, which is a dependency manager for PHP. Then we can install the Google API client to be able to perform API calls to GSheets to pull data from there.

  1. Verify that your PHP version is in the minimum required supported version of PHP, as Gravity Forms follow that.
jan@entelechia:~$ php -v
PHP 7.3.14-1~deb10u1 (cli) (built: Feb 16 2020 15:07:23) ( NTS )
Copyright (c) 1997-2018 The PHP Group
  1. Update your OS,, verify/update your PHP-JSON library + Composer requirements.
# CentOS:
sudo yum update
sudo yum install php-json php-cli curl

# Debian/Ubuntu:
sudo apt update && sudo apt upgrade
sudo apt-get install php-json php-cli curl -y
  1. Install Composer. If you are running on a test web server, you can switch over to the ‘root’ account by running ‘sudo su’, but this is not a recommended practice in any production system.
mkdir -p /tmp/composer
cd /tmp/composer
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
  1. Verify that Composer can be queried. It is not recommended to run Composer from a root account.
jan@entelechia:/tmp/composer/$ composer -V
Composer version 2.0.11 2021-02-24 14:57:23
  1. Install the required library for Google client API.
    • Note: It is possible to just to download the API Client from Github and unzip it into a folder that you will be using. But if you do that, Composer will not be actively maintaining it for you. This approach is only recommended if there is an important bug fix that is only available in the version history system but not yet pushed into Composer.
    • Check what is the current newest version of the API Client – e.g. 2.9.1
jan@entelechia:/tmp/composer$ composer require google/apiclient:^2.9.1

6. Note that a folder called ‘vendor’ is created with some other library folders such as ‘firebase’, ‘guzzlehttp’ and ‘google’. This is what we will need for the next step.

jan@entelechia:/tmp/composer$ ls vendor/
autoload.php  composer  firebase  google  guzzlehttp  monolog  paragonie  phpseclib  psr  ralouphie

Sources:

  • Linuxize
  • Linuxconfig
  • Develike

Create a Google Service Account + Key
Utilize Composer to talk to Google Sheets API
Go back to course overview: Dynamically Populate Gravity Forms from Google Sheets (GSheets APIv4) > Part 1 - Get GSheets API working with your WordPress instance

Leave a Comment Cancel Reply

Save my name, email, and website in this browser for the next time I comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 FacebookWhatsappEmail

Course Steps

    1. Create a Google Service Account + Key
    2. Install Composer + Google API Client (Linux)
    3. Utilize Composer to talk to Google Sheets API
    4. Use GSheets APIv4 in WordPress using the Code Snippets plugin
    4 lessons
    1. Example 1a: Purchase orders - load a list of clients into a Gravity Forms dropdown from a GSheet
    2. Example 1b: Purchase orders - load a list of projects from a GSheet based on the previously selected clients into a Gravity Forms dropdown
    2 lessons
Previous Next

Recent Comments

  • Jan Bachelor on Dynamic DNS Set Up with DuckDNS on OPNSenseHi Jake, that's awesome, congratulations on getting…
  • Jake on Dynamic DNS Set Up with DuckDNS on OPNSensefollowed guide above to the T and all is working. i…
  • Fastbrain on Dynamic DNS Set Up with DuckDNS on OPNSenseThanks for the guide. For some reason, after follow…

Other courses

Install iRedMail Mail Server As Proxmox VM With...

October 31, 2024

Remote Bucket Storage for Proxmox VM Backups

August 16, 2024

Concur Alternative: Import Employees’ Credit Card Expenses to...

January 19, 2024

Create an automated Gravity workflow that will allow...

January 19, 2024

Dynamically Populate Gravity Forms from Google Sheets (GSheets...

March 16, 2021
Bachelor Tech
  • Home
  • Tutorials
  • Portfolio
  • About Jan
  • Contact Jan

Recent Posts

  • How to join two Proxmox nodes into a cluster (PVE 8.x)

  • How to Rename a Proxmox Node

  • How to mount an NFS share on an Android box

Facebook Twitter Instagram Pinterest Linkedin Youtube

All Rights Reserved. The theme was customized from Soledad, see PenciDesign