{"id":3925,"date":"2015-02-20T13:47:01","date_gmt":"2015-02-20T19:47:01","guid":{"rendered":"https:\/\/icesquare.com\/wordpress\/?p=3925"},"modified":"2015-02-20T13:48:49","modified_gmt":"2015-02-20T19:48:49","slug":"freebsdupgrade-php-5-5-to-5-6","status":"publish","type":"post","link":"https:\/\/icesquare.com\/wordpress\/freebsdupgrade-php-5-5-to-5-6\/","title":{"rendered":"[FreeBSD]Upgrade PHP 5.5 to 5.6"},"content":{"rendered":"<p>It is not easy to upgrade PHP 5.5 to 5.6 in FreeBSD. Without proper preparation, the upgrade process may drive you nut. Before you decide to get your hands wet, here are what I recommend you to do:<\/p>\n<ol>\n<li>Back up your files<\/li>\n<li>Test your website in a PHP 5.6 environment on a different server. It is because PHP 5.6 has introduced some backward incompatibilities. Some of the codes written in the prior versions may introduce run time error. See <a href=\"http:\/\/php.net\/manual\/en\/migration56.incompatible.php\" target=\"_blank\">here<\/a> for more information.<\/li>\n<li>Schedule a down time. Depending on your CPU speed \/ typing speed \/ trouble-shooting skill, it may take you an hour.<\/li>\n<\/ol>\n<h2>Background<\/h2>\n<p>I am assuming that you use PHP for web purposes (rather than command line \/ CLI only), and I am assuming that you are using PHP with Apache. Here are the ports you will need to touch:<\/p>\n<ul>\n<li><strong>Apache<\/strong>: \/usr\/ports\/www\/apache22 or \/usr\/ports\/www\/apache24<\/li>\n<li><strong>Apache-PHP<\/strong>: \/usr\/ports\/www\/mod_php56<\/li>\n<li><strong>PHP<\/strong>: \/usr\/ports\/lang\/php56<\/li>\n<li><strong>PHP Extensions<\/strong>: \/usr\/ports\/lang\/php56-extensions<\/li>\n<\/ul>\n<h2>1. Remove the old PHP and extensions<\/h2>\n<pre>\r\ncd \/usr\/ports\/lang\/php55\r\nsudo make deinstall clean\r\n\r\n\r\ncd \/usr\/ports\/lang\/php55-extensions\r\nsudo make deinstall clean\r\n<\/pre>\n<h2>2. Install PHP 5.6<\/h2>\n<pre>\r\ncd \/usr\/ports\/lang\/php56\r\n\r\n#Don't forget enable ZTS if you have threaded Apache.\r\nsudo make install clean\r\n<\/pre>\n<h2>3. Install PHP 5.6 Extensions<\/h2>\n<pre>\r\ncd \/usr\/ports\/lang\/php56-extensions\r\nsudo make install clean\r\n<\/pre>\n<h2>4. Test PHP and its extensions<\/h2>\n<pre>\r\nphp -v\r\nphp -m\r\n\r\nClean up the error by removing the duplicated entries in:\r\n\/usr\/local\/etc\/php\/extensions.ini\r\n<\/pre>\n<h2>5. Rebuild the Apache-PHP Bridge<\/h2>\n<pre>\r\ncd \/usr\/ports\/www\/mod_php55\r\nsudo make deinstall clean\r\n\r\ncd \/usr\/ports\/www\/mod_php56\r\n#Don't forget enable ZTS if you have threaded Apache.\r\nsudo make install clean\r\n<\/pre>\n<h2>6. Restart Apache<\/h2>\n<pre>\r\nsudo \/usr\/local\/etc\/rc.d\/apache restart\r\n<\/pre>\n<h2>7. Test PHP using phpinfo<\/h2>\n<p>Create a code called test.php to display phpinfo. Verify that everything is okay.<\/p>\n<pre>\r\n< ?php\r\nphpinfo();\r\n?>\r\n<\/pre>\n<h2>8. Reinstall Apache (optional)<\/h2>\n<p>If you experience any problem, try to reinstall the following ports:<\/p>\n<pre>\r\nApache: \/usr\/ports\/www\/apache22 or \/usr\/ports\/www\/apache24\r\nApache-PHP: \/usr\/ports\/www\/mod_php56\r\n<\/pre>\n<p>That&#8217;s it! Enjoy the new PHP!<\/p>\n<p>&#8211;Derrick<\/p>\n<div style=\"margin-bottom:50px;\"> <\/div>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is not easy to upgrade PHP 5.5 to 5.6 in FreeBSD. Without proper preparation, the upgrade process may drive you nut. Before you decide to get your hands wet, <a class=\"more-link\" href=\"https:\/\/icesquare.com\/wordpress\/freebsdupgrade-php-5-5-to-5-6\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[94,146,7,10,144,6,69],"tags":[171,172],"class_list":["post-3925","post","type-post","status-publish","format-standard","hentry","category-computer-problems-computer-help-pc-support","category-everyday-computer-problem","category-freebsd","category-php","category-sever-problem","category-technology","category-troubleshooting-technology","tag-freebsd","tag-php"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p1sqzr-11j","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":3514,"url":"https:\/\/icesquare.com\/wordpress\/freebsdphp-does-not-work-after-upgrading-apache-to-2-2-27\/","url_meta":{"origin":3925,"position":0},"title":"[FreeBSD]PHP does not work after upgrading Apache to 2.2.27","author":"Derrick","date":"April 11, 2014","format":false,"excerpt":"I upgraded the Apache to 2.2.27 on my FreeBSD box via portmaster. The upgrade went very smooth. After the upgrade, I found that Apache no longer rendered the PHP page correctly. In the other words, it displayed the source code of the PHP files instead of executing the code. Before\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":603,"url":"https:\/\/icesquare.com\/wordpress\/weird-php-error-after-freebsd-port-upgrade\/","url_meta":{"origin":3925,"position":1},"title":"Weird PHP Error after FreeBSD port upgrade (PHP Warning:  PHP Startup: Unable to load dynamic library)","author":"Derrick","date":"April 6, 2010","format":false,"excerpt":"Today I upgraded the port on my FreeBSD box using portmaster tools: portmaster -Dai After that, I found that the PHP gave the following weird error: php -v PHP Warning: PHP Startup: Unable to load dynamic library '\/usr\/local\/lib\/php\/20060613\/memcached.so' - \/usr\/local\/lib\/php\/20060613\/memcached.so: Undefined symbol \" php_session_create_id\" in Unknown on line 0 PHP\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2792,"url":"https:\/\/icesquare.com\/wordpress\/phpfreebsd-the-databasesphp5-sqlite-port-has-been-deleted-removed-from-core-php-aborting-update\/","url_meta":{"origin":3925,"position":2},"title":"[PHP\/FreeBSD]===>>> The databases\/php5-sqlite port has been deleted: Removed from core php ===>>> Aborting update","author":"Derrick","date":"May 17, 2012","format":false,"excerpt":"[ad#adbrite] When PHP 5.4 was available few months ago, I was hesitated to upgrade my FreeBSD box to upgrade to 5.4, because it comes with lots of big changes, including removing LOTS of old stuffs that were available in 5.3 or earlier versions. Today PHP 5.4.3 becomes available in FreeBSD\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2777,"url":"https:\/\/icesquare.com\/wordpress\/solvedproblem-to-update-openldap-in-freebsd\/","url_meta":{"origin":3925,"position":3},"title":"[Solved]Problem to Update OpenLDAP in FreeBSD","author":"Derrick","date":"April 29, 2012","format":false,"excerpt":"Recently, I found the following error message when updating my FreeBSD system regarding to the OpenLDAP: ===> Installing for openldap-client-2.4.31 ===> Generating temporary packing list ===> Checking if net\/openldap24-client already installed ===> Creating users and\/or groups. Using existing group `ldap'. Creating user `ldap' with uid `389'. pw: user 'ldap' already\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3596,"url":"https:\/\/icesquare.com\/wordpress\/shared-object-libsqlite3-so-8-not-found\/","url_meta":{"origin":3925,"position":4},"title":"Shared object &#8220;libsqlite3.so.8&#8221; not found","author":"Derrick","date":"July 1, 2014","format":false,"excerpt":"I noticed some weird thing on my server today. When I ran some PHP code, I got the following error: PHP Warning: PHP Startup: Unable to load dynamic library '\/usr\/local\/lib\/php\/20121212-zts\/pdo_sqlite.so' - Shared object \"libsqliteo_sqlite.so\" in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library '\/usr\/local\/lib\/php\/20121212-zts\/pdo_sqlite.so' - Shared\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1927,"url":"https:\/\/icesquare.com\/wordpress\/phphow-to-get-the-number-of-cpu-cores-in-fedora-ubuntu-and-freebsd\/","url_meta":{"origin":3925,"position":5},"title":"[PHP]How to get the number of CPU cores in Fedora, Ubuntu, and FreeBSD","author":"Derrick","date":"December 2, 2011","format":false,"excerpt":"I am working on a PHP application which needs to be deploy to multiple places. One of the variables is the number of CPU core. Since each server has different number of CPU cores, I need to specify the number of CPU core in my application for each server. I\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/3925","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/comments?post=3925"}],"version-history":[{"count":8,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/3925\/revisions"}],"predecessor-version":[{"id":3933,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/3925\/revisions\/3933"}],"wp:attachment":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/media?parent=3925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/categories?post=3925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/tags?post=3925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}