How would I install cURL on the PHP Web Server?

Hello,

Is it possible to install cURL on the server replit runs for PHP? If so, how?

It may be blocked, however literally everything uses cURL.

  • KadenBlox

Yes! You can install cURL via Nix. Modify your replit.nix file to include pkgs.curl

For more information see Configuring a Repl | Replit Docs
You can also search the available Nix packages here: NixOS Search

2 Likes

Hi there! Thanks for the response.
I’m just a beginner PHP dev, I don’t really know how this nix stuff works

I create a file called replit.nix and then I put what in it?

You don’t need to create the file. Click the 3 dots at the top of the file tree and show hidden files. Open replit.nix and then add pkgs.curl under the rest of the packages.

2 Likes
{ pkgs }: {
	deps = [
		pkgs.php74
        pkgs.curl
	];
}

i got this now, going to check if it works

1 Like

I’m assuming you mean PHP cURL, in which case it’s pkgs.php74Extensions.curl.