PHP 8.0 build "error: attribute 'json' missing"

My project ID c0821839-fe34-4bbb-8872-93446a76aec3, Its a CodeIgniter app with uuid is using PHP 8.1, railway build with 8.0 and its showing this error: context: cb02218c96c8c58a2d28297cc916216d ╔═══════════════════════════════ Nixpacks v1.5.1 ══════════════════════════════╗ ║ setup │ (php80.withExtensions (pe: pe.enabled ++ [pe.all.json ║ ║ │ pe.all.mbstring pe.all.intl])), perl, nginx, libmysqlclient, ║ ║ │ php80Packages.composer, php80Extensions.json, ║ ║ │ php80Extensions.mbstring, php80Extensions.intl ║ ║──────────────────────────────────────────────────────────────────────────────║ ║ install │ mkdir -p /var/log/nginx && mkdir -p /var/cache/nginx ║ ║ │ composer install --ignore-platform-reqs ║ ║──────────────────────────────────────────────────────────────────────────────║ ║ start │ php-fpm -y /assets/php-fpm.conf & nginx -c /app/nginx.conf ║ ╚══════════════════════════════════════════════════════════════════════════════╝ ... #8 [4/9] RUN nix-env -if .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix && nix-collect-garbage -d #8 22.63 installing '293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847-env' #8 23.05 error: attribute 'json' missing #8 23.05 #8 23.05 at /app/.nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix:6:88: #8 23.05 #8 23.05 5| let #8 23.05 6| APPEND_LIBRARY_PATH = "${lib.makeLibraryPath [ libmysqlclient php80Extensions.intl php80Extensions.json php80Extensions.mbstring ] }"; #8 23.05 | ^ #8 23.05 7| myLibraries = writeText "libraries" '' #8 23.05 (use '--show-trace' to show detailed location information)
15 Replies
Percy
Percy14mo ago
Project ID: c0821839-fe34-4bbb-8872-93446a76aec3
Brody
Brody14mo ago
railway supports php 8.0/8.1/8.2 with the default being 8.2 the version is detected from your composer.json file check what version is set in your composer.json file
Eze Prieto
Eze Prieto14mo ago
Thanks @Brody, my composer has: "php": "^7.4 || ^8.0"
Brody
Brody14mo ago
try pinning it to the specific version you want railway to use
Eze Prieto
Eze Prieto14mo ago
I try it before, but the setup of nixpack says that php80Extensions.json is enabled and later don't find it. With 8.1 was the same the problem start when I setup / as root there is a public and app folder if I setup the root at /public builds ok, but in the build only have the content of /public
Brody
Brody14mo ago
@aleks - can you take over from here when you have some time? ^ he knows about php, I do not
Eze Prieto
Eze Prieto14mo ago
Thanks!
Brody
Brody14mo ago
please wait patiently and he will come help when he has some free time
Eze Prieto
Eze Prieto14mo ago
Yes! Thanks again I will write a post on CodeIgniter Forum when we resolved this: Deploy to Railway in a few seconds
root
root14mo ago
Oh... is there a package called ext-json that you're requiring? Oh, never mind, I have misdiagnosed. Looks like this will require a change in Nixpacks, please hold.
root
root14mo ago
GitHub
fix(php): don't install ext-json by aleksrutins · Pull Request #896...
Since ext-json is included in PHP >= 8 itself (and not available in Nixpkgs), this PR skips over it when figuring out which extensions to install.
Eze Prieto
Eze Prieto14mo ago
Thanks @aleks
Brody
Brody14mo ago
11.3k line changes, wow the team member that usually maintains nixpacks is on a little vacation right now, so we don't know when that will get merged, there's also other factors like the nixpacks version that aleks wants to merge into breaks some python apps, so it might be a while unfortunately
root
root14mo ago
I added another laravel example
Eze Prieto
Eze Prieto14mo ago
Hi guys! Without the json extesion build ok, I have some concerns: I need to change permissions to a folder to be writeable, and the other is I need to point the root of nginx to /public for nginx i copied the template but in the deployment console shows errors like nginx: [emerg] host not found in "${PORT}" of the "listen" directive in /app/nginx.conf:25
Want results from more Discord servers?
Add your server
More Posts