{"id":2368,"date":"2023-05-12T02:14:38","date_gmt":"2023-05-12T01:14:38","guid":{"rendered":"https:\/\/arcanius.silverfir.net\/blog\/?p=2368"},"modified":"2023-11-04T23:55:34","modified_gmt":"2023-11-04T23:55:34","slug":"php-7-4-8-1-upgrade-fixes","status":"publish","type":"post","link":"https:\/\/arcanius.silverfir.net\/blog\/php-7-4-8-1-upgrade-fixes\/","title":{"rendered":"PHP 7.4 -> 8.1 Upgrade Fixes"},"content":{"rendered":"<p>When upgrading a couple of my servers to the latest Ubuntu, I ran into an issue with my php-based websites, including this one, where I was getting a simple yet inscrutible &#8220;File not found.&#8221; message instead of the php website.<\/p>\n<p>Digging in, I found a few clues initially:<\/p>\n<ul>\n<li>The latest LTS of ubuntu (only a year old now :-p) had upgraded to PHP 8.1 from PHP 7.4, changing the php-fpm system I use to run these sites in a few ways<\/li>\n<li>Static pages still loaded fine, so nginx was basically working<\/li>\n<li>Eventually, by enabling php-fpm access logging and using <a href=\"https:\/\/stackoverflow.com\/questions\/35261922\/how-to-debug-fastcgi-sent-in-stderr-primary-script-unknown-while-reading-respo\">this helpful answer<\/a>, I verified that the issue had something to do with nginx no longer correctly passing the url to php-fpm.<\/li>\n<\/ul>\n<p>Poking around a bit more and diffing the default 7.4 and 8.1 fpm server files, I found that it turns out that php-fpm 8.1 moved a bunch of config settings that make php work easily into <tt>snippets\/fastcgi-php.conf<\/tt>. By including this file and removing the <tt>fastcgi_index<\/tt> and <tt>include fastcgi_params<\/tt> directives, I was able to restore order to my hosted sites.<\/p>\n<p>Not exactly how I wanted to spend Friday morning, but onward! Hopefully this helps someone out there some day.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When upgrading a couple of my servers to the latest Ubuntu, I ran into an issue with my php-based websites, including this one, where I was getting a simple yet inscrutible &#8220;File not found.&#8221; message instead of the php website. Digging in, I found a few clues initially: The latest LTS of ubuntu (only a [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[8],"class_list":["post-2368","post","type-post","status-publish","format-standard","hentry","category-everything","tag-technology"],"_links":{"self":[{"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/posts\/2368","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/comments?post=2368"}],"version-history":[{"count":5,"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/posts\/2368\/revisions"}],"predecessor-version":[{"id":2397,"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/posts\/2368\/revisions\/2397"}],"wp:attachment":[{"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/media?parent=2368"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/categories?post=2368"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arcanius.silverfir.net\/blog\/wp-json\/wp\/v2\/tags?post=2368"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}