Upgrade PHP version

Dear Replit Team

If it’s possible, Please upgrade the PHP version to the latest one 8.1 which currently is 7.4

Thanks a lot :slight_smile:

run in shell:

sed -i 's/stable-.*/unstable/' .replit
sed -i 's/74//' replit.nix
1 Like

it`s not working still 7.4
I need the 8.1 version or higher

oops, the shell reloads after the first line gets evaluated. See what version it takes you to when you enter just the second line

sed -i 's/74//' replit.nix

it`s not working again still 7.4

ok, can you send a link to your repl?

https://replit.com/@KingMasr/UnkemptFloweryMap

In your Repl you can edit the .replit and replit.nix files in order to change the version of PHP (also note the latest version of PHP available via Nix is actually PHP 8.2.0RC7, not sure if the RC7 is relevant…).

In .replit I added this line (if there is already a line like this, just make the channel string match):

[nix]
channel = "stable-22_11"

In replit.nix I just changed pkgs.php74 to pkgs.php82:

{ pkgs }: {
	deps = [
		pkgs.php82
	];
}

Then in the shell I entered kill 1 (which should force Nix changes to be applied just in case). I ran the Repl, which worked, then went to the shell and entered PHP -v to confirm the version was changed successfully, which it was!

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.