Set up PHP for Development IDE

Hi all,

some time now here, using NixOS, and I am migrating more and more over to the new OS. I am a Web and Software Developer, using JetBrains IDEs. Some languages, like PHP and Java, require setting up an interpreter. I am working on a PHP project right now, so this is what I am trying to set up.

I installed the PHP package. However, the IDE is not able to find it. Is there anything I am missing? At which path would PHP be found?

Any help would be appreciated.

Hello,

You should create a shell with PHP, something like: nix shell nixpkgs#php83, then only start Intellij from the shell so that it can have access to PHP.

Good luck and welcome to the Nix community!

I have found it… after clicking on the folder icon next to it and then on the plus, I was able to add it. It is located at /run/current-system/sw/bin/php.

Oh, cool! Yeah, I am still not used to being able to create a shell for whatever I need! :slight_smile:
I will try that out too… as it sounds much more flexible.

Cheers and thanks for the welcome.

Also look into https://direnv.net/, which will automatically enable your shell once you enter that directory. And it integrates with nix nicely.

1 Like