{"id":2502,"date":"2012-01-12T13:54:34","date_gmt":"2012-01-12T19:54:34","guid":{"rendered":"http:\/\/icesquare.com\/wordpress\/?p=2502"},"modified":"2012-01-12T21:20:59","modified_gmt":"2012-01-13T03:20:59","slug":"freebsdproblem-to-update-php-port","status":"publish","type":"post","link":"https:\/\/icesquare.com\/wordpress\/freebsdproblem-to-update-php-port\/","title":{"rendered":"[FreeBSD]Problem to update PHP port"},"content":{"rendered":"<p><img decoding=\"async\" src=\"\/wordpress\/wp-content\/uploads\/2012\/01\/PHP-Problem.jpg\" class=\"alignleft\" width=\"300\"\/><\/p>\n<p>A new version of PHP (5.3.9) was available in FreeBSD today. Since it contained a lot of security fixes and enhancements, I decided to give it a try. After testing the new PHP in couple test servers, I think it is ready to upgrade the PHP on the production server. Oh well, I didn&#8217;t expect that I needed to spend my whole lunch break to trouble-shoot this problem. So here is what I did:<\/p>\n<pre style=\"margin-top:50px;\">\r\n# cd \/usr\/ports\/lang\/php5\r\n# make install\r\n===>  Vulnerability check disabled, database not found\r\n===>  License check disabled, port has not defined LICENSE\r\n===>  Found saved configuration for php5-5.3.9\r\n===>  Extracting for php5-5.3.9\r\n=> SHA256 Checksum mismatch for php-5.3.9.tar.bz2.\r\n=> SHA256 Checksum OK for suhosin-patch-5.3.4-0.9.10.patch.gz.\r\n===>  Refetch for 1 more times files: php-5.3.9.tar.bz2\r\n===>  Vulnerability check disabled, database not found\r\n===>  License check disabled, port has not defined LICENSE\r\n===>  Found saved configuration for php5-5.3.9\r\n=> php-5.3.9.tar.bz2 doesn't seem to exist in \/usr\/ports\/distfiles\/.\r\n=> Attempting to fetch from http:\/\/dk.php.net\/distributions\/.\r\nfetch: http:\/\/dk.php.net\/distributions\/php-5.3.9.tar.bz2: Requested Range Not Satisfiable\r\n=> Attempting to fetch from http:\/\/de.php.net\/distributions\/.\r\nfetch: http:\/\/de.php.net\/distributions\/php-5.3.9.tar.bz2: Requested Range Not Satisfiable\r\n=> Attempting to fetch from http:\/\/es.php.net\/distributions\/.\r\nfetch: http:\/\/es.php.net\/distributions\/php-5.3.9.tar.bz2: Requested Range Not Satisfiable\r\n=> Attempting to fetch from http:\/\/fi.php.net\/distributions\/.\r\nfetch: http:\/\/fi.php.net\/distributions\/php-5.3.9.tar.bz2: Requested Range Not Satisfiable\r\n=> Attempting to fetch from http:\/\/fr.php.net\/distributions\/.\r\n===>  Vulnerability check disabled, database not found\r\n===>  License check disabled, port has not defined LICENSE\r\n===>  Found saved configuration for php5-5.3.9\r\n=> SHA256 Checksum mismatch for php-5.3.9.tar.bz2.\r\n=> SHA256 Checksum OK for  suhosin-patch-5.3.9-0.9.10.patch.gz\r\n===>  Giving up on fetching files: php-5.3.9.tar.bz2\r\nMake sure the Makefile and distinfo file (\/usr\/ports\/lang\/php5\/distinfo)\r\nare up to date.  If you are absolutely sure you want to override this\r\ncheck, type \"make NO_CHECKSUM=yes [other args]\".\r\n*** Error code 1\r\n\r\nStop in \/usr\/ports\/lang\/php5.\r\n*** Error code 1\r\n\r\nStop in \/usr\/ports\/lang\/php5.\r\n*** Error code 1\r\n\r\nStop in \/usr\/ports\/lang\/php5.\r\n<\/pre>\n<p>Initially, I thought it was a checksum error. So I decided to skip the checksum, i.e.,<\/p>\n<pre>\r\n#make install NO_CHECKSUM=yes\r\n<\/pre>\n<p>Unfortunately, it gave the same error. I think the problem might come from corrupted port files or port database. Instead of finding the source of the problem, I decided to rebuild the whole thing.<\/p>\n<p>First, let&#8217;s remove the port database:<\/p>\n<p><\/p>\n<pre>\r\n#sudo rm -Rf \/var\/db\/portsnap\/*\r\n<\/pre>\n<p>Next, we need to re-download all port files:<\/p>\n<pre>\r\n#sudo portsnap fetch extract\r\n<\/pre>\n<p>Some new ports may be released during the extraction, let&#8217;s make sure that the port tree is up to date:<\/p>\n<pre>\r\n#sudo portsnap fetch update\r\n<\/pre>\n<p>Now, we need to manually download the php source. Make sure that the file is stored in \/usr\/ports\/distfiles\/<\/p>\n<pre>\r\n#cd \/usr\/ports\/distfiles\/\r\n#sudo wget http:\/\/fi.php.net\/distributions\/php-5.3.9.tar.bz2\r\n<\/pre>\n<p>Now, try to test whether the system can build php again. Notice that this will not install the PHP in your system.<\/p>\n<pre>\r\ncd \/usr\/ports\/lang\/php5\r\nsudo make\r\n<\/pre>\n<p>If it gives no error, which means the PHP is ready to go. Now let&#8217;s clean up our work and make sure everything is ready.<\/p>\n<pre>\r\nsudo make clean\r\n<\/pre>\n<p>Notice that there is no way to upgrade the PHP from Make without uninstall it. Since it is a production server, I want to keep the website running. So I decide to let Portmaster to do all dirty works for me.<\/p>\n<pre>\r\nsudo portmaster -Da\r\n<\/pre>\n<p>Depending on your CPU, it may take 5 minutes to an hour to finish the update. Normally, the standard php package will work fine after the update. However, if it is not a standard package, such as PECL, you will need to do one more step. For example, here is the error messages right after I upgraded PHP:<\/p>\n<pre>\r\n#php -v\r\n[eAccelerator] This build of \"eAccelerator\" was compiled for PHP version 5.3.8.\r\nRebuild it for your PHP version (5.3.9) or download precompiled binaries.\r\n\r\nPHP Warning:  PHP Startup: Unable to load dynamic library '\/usr\/local\/lib\/php\/20090626\/memcache.so' - \/usr\/local\/lib\/php\/20090626\/memcache.so: Undefined symbol \"php_session_create_id\" in Unknown on line 0\r\n\r\nPHP Warning:  PHP Startup: Unable to load dynamic library '\/usr\/local\/lib\/php\/20090626\/tokyo_tyrant.so' - \/usr\/local\/lib\/php\/20090626\/tokyo_tyrant.so: Undefined symbol \"ps_globals\" in Unknown on line 0\r\n\r\nPHP 5.3.9 with Suhosin-Patch (cli) (built: Jan 12 2012 13:09:43)\r\nCopyright (c) 1997-2012 The PHP Group\r\nZend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies\r\n<\/pre>\n<h4>[eAccelerator] This build of &#8220;eAccelerator&#8221; was compiled for PHP version 5.3.8.<br \/>\nRebuild it for your PHP version (5.3.9) or download precompiled binaries.<\/h4>\n<p>To solve this problem, simple rebuild the package, i.e.,<\/p>\n<pre>\r\ncd \/usr\/ports\/www\/eaccelerator\r\nsudo make deinstall install clean\r\n<\/pre>\n<h4>\nPHP Warning:  PHP Startup: Unable to load dynamic library &#8216;\/usr\/local\/lib\/php\/20090626\/memcache.so&#8217; &#8211; \/usr\/local\/lib\/php\/20090626\/memcache.so: Undefined symbol &#8220;php_session_create_id&#8221; in Unknown on line 0<\/h4>\n<pre>\r\n#cd \/usr\/ports\/databases\/pecl-memcache\r\n#sudo make deinstall\r\n#sudo make install clean\r\n<\/pre>\n<h4>\nPHP Warning:  PHP Startup: Unable to load dynamic library &#8216;\/usr\/local\/lib\/php\/20090626\/tokyo_tyrant.so&#8217; &#8211; \/usr\/local\/lib\/php\/20090626\/tokyo_tyrant.so: Undefined symbol &#8220;ps_globals&#8221; in Unknown on line 0<br \/>\n<\/h4>\n<pre>\r\n#cd \/usr\/ports\/pecl-tokyo_tyrant\r\n#sudo make deinstall\r\n#sudo make install clean\r\n<\/pre>\n<p>After the re-installation is completed, make sure that PHP gives no complain:<\/p>\n<pre>\r\n#php -v\r\n\r\nPHP 5.3.9 with Suhosin-Patch (cli) (built: Jan 12 2012 13:09:43)\r\nCopyright (c) 1997-2012 The PHP Group\r\nZend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies\r\n<\/pre>\n<p>That&#8217;s it! Have fun.<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A new version of PHP (5.3.9) was available in FreeBSD today. Since it contained a lot of security fixes and enhancements, I decided to give it a try. After testing <a class=\"more-link\" href=\"https:\/\/icesquare.com\/wordpress\/freebsdproblem-to-update-php-port\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","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":false,"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,7,95,10,144,6,69],"tags":[171,172],"class_list":["post-2502","post","type-post","status-publish","format-standard","hentry","category-computer-problems-computer-help-pc-support","category-freebsd","category-howto","category-php","category-sever-problem","category-technology","category-troubleshooting-technology","tag-freebsd","tag-php"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p1sqzr-Em","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":2792,"url":"https:\/\/icesquare.com\/wordpress\/phpfreebsd-the-databasesphp5-sqlite-port-has-been-deleted-removed-from-core-php-aborting-update\/","url_meta":{"origin":2502,"position":0},"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":31,"url":"https:\/\/icesquare.com\/wordpress\/installing-apache-php-mysql-and-memcached-on-freebsd\/","url_meta":{"origin":2502,"position":1},"title":"Installing Apache, PHP, MySQL and MemCached on FreeBSD","author":"Derrick","date":"May 19, 2009","format":false,"excerpt":"This is my note on how to to install Apache, PHP, MySQL and MemCached on a FreeBSD 7 Box. 1. MySQL Go to the mysql52-server port directory by typing the command: cd \/usr\/ports\/databases\/mysql51-server Build the port by typing: make BUILD_OPTIMIZED=yes BUILD_STATIC=yes Using these two options will speed up the execution\u2026","rel":"","context":"In &quot;FreeBSD&quot;","block_context":{"text":"FreeBSD","link":"https:\/\/icesquare.com\/wordpress\/category\/sever-problem\/freebsd\/"},"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":2502,"position":2},"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":3514,"url":"https:\/\/icesquare.com\/wordpress\/freebsdphp-does-not-work-after-upgrading-apache-to-2-2-27\/","url_meta":{"origin":2502,"position":3},"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":2777,"url":"https:\/\/icesquare.com\/wordpress\/solvedproblem-to-update-openldap-in-freebsd\/","url_meta":{"origin":2502,"position":4},"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":41,"url":"https:\/\/icesquare.com\/wordpress\/installing-apache-php-mysql-and-memcached-on-os-x\/","url_meta":{"origin":2502,"position":5},"title":"Installing Apache, PHP, MySQL and MemCached on OS X","author":"Derrick","date":"May 19, 2009","format":false,"excerpt":"This is my note on how to to install Apache, PHP and MySQL on a an OS X box. Although some of these applications are come with the operating systems, it is always good to know how to upgrade them to the latest version. 1. Apple Developer Tools and Mac\u2026","rel":"","context":"In &quot;Server Problems&quot;","block_context":{"text":"Server Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/sever-problem\/"},"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\/2502","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=2502"}],"version-history":[{"count":19,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/2502\/revisions"}],"predecessor-version":[{"id":2521,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/2502\/revisions\/2521"}],"wp:attachment":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/media?parent=2502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/categories?post=2502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/tags?post=2502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}