{"id":407,"date":"2007-03-29T19:16:22","date_gmt":"2007-03-29T19:16:22","guid":{"rendered":"http:\/\/www.bartbusschots.ie\/blog\/?p=407"},"modified":"2014-08-04T15:43:49","modified_gmt":"2014-08-04T15:43:49","slug":"some-things-to-watch-out-for-when-upgrading-php5-on-freebsd","status":"publish","type":"post","link":"https:\/\/www.bartbusschots.ie\/s\/2007\/03\/29\/some-things-to-watch-out-for-when-upgrading-php5-on-freebsd\/","title":{"rendered":"Some Things to Watch Out For When Upgrading PHP5 on FreeBSD"},"content":{"rendered":"<p>Just a little follow on form my earlier bit of un-planned down time. The reason for the downtime was that I ran into three problems while upgrading the <code>php5-cgi<\/code> port. In this post I&#8217;m going to detail the solutions, mainly so I have easy access to them next time I upgrade PHP5 on a FreeBSD machine, but also because this may be of some use to someone somewhere some time.<\/p>\n<p>[tags]FreeBSD, PHP5[\/tags]<\/p>\n<p><!--more--><\/p>\n<p>The first pitfall I hit was not realising that upgrading <code>php5-cgi<\/code> with the command <code>portupgrade -R<\/code> will NOT also upgrade the other php5 modules you have installed like <code>php5-session<\/code> etc.. What happens is that <code>php5-cgi<\/code> builds and all looks well until you try to access a php page and you get a  HTTP 500 error. This happens because the new <code>php-cgi<\/code> won&#8217;t find the <code>.so<\/code> files for the old versions of the php modules. To fix this you have to go to the port for each of your php modules and do a <code>make reinstall<\/code>. If you&#8217;re under stress and accidentally do <code>make clean<\/code> followed by <code>make install<\/code> instead you&#8217;ll create a new problem for yourself. That causes duplicate entries in <code>\/usr\/local\/etc\/php\/extensions.ini<\/code> which will also cause HTTP 500 errors. And yes, I did find this out the hard way earlier today \ud83d\ude42<\/p>\n<p>Finally, for some strange reason upgrading <code>php5-cgi<\/code> resulted in the simlink <code>\/usr\/local\/www\/cgi-bin\/php<\/code> pointing to the wrong file in <\/code>\/usr\/local\/bin<\/code>. That simlink should look like the following or you&#8217;ll get HTTP 500 errors:<\/p>\n<pre>\r\nlrwxr-xr-x  1 root  wheel   22 Mar 29 15:53 php -> \/usr\/local\/bin\/php-cgi\r\n<\/pre>\n<p>It should NOT look like this:<\/p>\n<pre>\r\nlrwxr-xr-x  1 root  wheel   22 Mar 29 15:53 php -> \/usr\/local\/bin\/php\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Just a little follow on form my earlier bit of un-planned down time. The reason for the downtime was that I ran into three problems while upgrading the php5-cgi port. In this post I&#8217;m going to detail the solutions, mainly so I have easy access to them next time I upgrade PHP5 on a FreeBSD [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[12,446],"tags":[452,431,415],"series":[],"class_list":["post-407","post","type-post","status-publish","format-standard","hentry","category-computers-tech","category-sysadmin","tag-freebsd","tag-php","tag-unix"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p7t9xK-6z","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/posts\/407","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/comments?post=407"}],"version-history":[{"count":1,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/posts\/407\/revisions"}],"predecessor-version":[{"id":7456,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/posts\/407\/revisions\/7456"}],"wp:attachment":[{"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/media?parent=407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/categories?post=407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/tags?post=407"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/series?post=407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}