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

Install Composer + Google API Client (Linux)

by Jan Bachelor March 16, 2021

Last Updated on March 16, 2021 by Jan Bachelor

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.
[email protected]:~$ 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.
[email protected]:/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
[email protected]:/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.

[email protected]:/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
Back to: 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 comment 0 FacebookWhatsappEmail

Dynamically Populate Gravity Forms from Google Sheets (GSheets APIv4)

  • Previous
  • Next
Collapse
Expand
  • Part 1 - Get GSheets API working with your WordPress instance

  • Create a Google Service Account + Key
  • Install Composer + Google API Client (Linux)
  • Utilize Composer to talk to Google Sheets API
  • Use GSheets APIv4 in WordPress using the Code Snippets plugin
  • Part 2 - Examples for loading GSheets into Gravity Forms

  • Example 1a: Purchase orders - load a list of clients into a Gravity Forms dropdown from a GSheet
  • Example 1b: Purchase orders - load a list of projects from a GSheet based on the previously selected clients into a Gravity Forms dropdown

Search for articles

Other Tips

  • How to mount an NFS share (such as from FreeNAS) from an Android box
  • How to download a Windows 10 ISO on a Windows device – easy work-around

Other Tutorials

  • Build Your Own Router - Proxmox, OPNSense, OpenVPN server and a VPN client all in one!
    12 Steps
  • Dynamically Populate Gravity Forms from Google Sheets (GSheets APIv4)
    6 Steps

Recent Comments

  • Jan Bachelor on Use Integromat to get computer IDs from user email in JamF ProHi Robert, the static groups were created in the p…
  • Robert Petitto on Use Integromat to get computer IDs from user email in JamF ProCan you share how you'd use Make (integromat) to a…
  • Martin on Part 1 – What do we want to do + Required technology (bank feed)This tutorial deserves more credit, I've not seen…
  • Jan Bachelor on WAN / LAN Set Up (Before OPNSense Installation)Hi Ed, I have not tested it with PCI passthrough y…
  • Ed on OPNSense VM Set UpIn step 4 firewall you turned off firewall, should…

Tags

chrome iso windows

Categories

  • Android
  • FreeNAS
  • Linux
  • Windows

Recent Posts

  • How to mount an NFS share (such as from FreeNAS) from an Android box

  • How to download a Windows 10 ISO on a Windows device – easy work-around

Facebook Twitter Instagram Pinterest Linkedin Youtube

@2019 - All Right Reserved. Designed and Developed by PenciDesign

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