Google’s IDX with PHP: First Look

Abdulbasit Rubeya
2 min readFeb 8, 2024

--

IDX is a web-based workspace for full-stack application development, representing an experimental initiative by Google to streamline the entire workflow for multiplatform app development in the cloud.

While IDX offers a plethora of tools and templates across various languages and frameworks, PHP developers might find it challenging to start with anything other than a blank template or repository. In this guide, we will delve into the process of utilizing the IDX project specifically for PHP development.

1. Open to IDX

To begin the journey with IDX for PHP development, visit the IDX workspace at https://idx.google.com.

Once there, choose a template that aligns with your project needs. Note that IDX access may not be available to everyone, so if you don’t have access, consider joining the waitlist.

2. Add PHP bin packages

After setting up your project, locate the .idx folder within your project directory, Inside this folder, find thedev.nix located at .idx/gc/dev.nix Open the file and proceed to add PHP packages to your configuration.

You can find a comprehensive list of packages to install specific PHP versions or additional packages from here if you wish to install a specific version of PHP or extra packages, on the packages section add pkgs.php81 to install php81, and pkgs.php81Packages.composer if you wish to have a composer in your project.

Roughly your workspace configuration file should be something like this

{ pkgs, ... }: {
channel = "stable-23.11"; # "stable-23.11" or "unstable"
packages = [
pkgs.php81
pkgs.php81Packages.composer
# pkgs.otherPackages
];
env = {};
idx.extensions = [
# "vscodevim.vim"
];
idx.previews = {
};
}

Once you’ve edited the configuration file, a button in the bottom right corner will prompt you to rebuild your workspace environment. Click “Rebuild,” and now your IDX workspace is configured to support PHP, allowing you to execute and run PHP commands seamlessly.

Cheers

--

--

Abdulbasit Rubeya
Abdulbasit Rubeya

Responses (1)