{"id":1053,"date":"2017-04-10T12:44:49","date_gmt":"2017-04-10T17:44:49","guid":{"rendered":"http:\/\/lisa.rushworth.us\/?p=1053"},"modified":"2017-04-10T14:19:23","modified_gmt":"2017-04-10T19:19:23","slug":"uninformed-upgrades-php-5-7","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=1053","title":{"rendered":"Uninformed Upgrades (PHP 5 => 7)"},"content":{"rendered":"<p>TL;DR: Check the list of what is being updated before you let an OS automatically update its programs.<\/p>\n<p>We have a home automation \/\u00a0MythTV \/ ZoneMinder server\u00a0with automatic updates disabled.\u00a0In the process of updating OpenHAB to OpenHAB2, Scott suggested we update everything else while we&#8217;re at it. No big, did a quick &#8220;dnf update&#8221; &#8230; got a gig of packages downloaded, waiting for\u00a0&gt;1400 packages to install, and\u00a0rebooted.<\/p>\n<p>PHP could not talk to MySQL. At all. ZoneMinder just threw an error saying we didn&#8217;t have the PHP MySQL module installed (it worked half an hour ago, so it is INSTALLED). MythWeb\u00a0completely failed to load &#8211; just a white screen. The quick web view of OpenHAB persistence history threw a class not found error.<\/p>\n<p>I checked to see if the extensions were loaded (use the command &#8220;print_r(get_loaded_extensions());&#8221; in a PHP page) &#8211; huh, a LOT of my modules were missing.\u00a0But there weren&#8217;t any\u00a0<em>useful<\/em> errors anywhere indicating <em>why<\/em>.<\/p>\n<p>I modified the php.ini file to show startup errors.<\/p>\n<p>[root@fedora01 conf.modules.d]# grep display_startup_errors \/etc\/php.ini<br \/>\n; display_startup_errors<br \/>\ndisplay_startup_errors = On<\/p>\n<p>Oooooh, now there are errors! A\u00a0<em>lot<\/em> of them. Not particularly useful, but at least a good clue that this isn&#8217;t going to go so well for me:<\/p>\n<p>PHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/pdo.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/pdo.so: undefined symbol: zend_ce_exception in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/mysqlnd.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/mysqlnd.so: undefined symbol: zend_hash_str_del in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/bcmath.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/bcmath.so: undefined symbol: _emalloc_16 in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/bz2.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/bz2.so: undefined symbol: zend_fetch_resource2_ex in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/calendar.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/calendar.so: undefined symbol: _emalloc_32 in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: ctype: Unable to initialize module\\nModule compiled with module API=20151012\\nPHP compiled with module API=20131226\\nThese options need to match\\n in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/curl.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/curl.so: undefined symbol: zend_list_close in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/dom.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/dom.so: undefined symbol: zend_ce_exception in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/exif.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/exif.so: undefined symbol: zend_hash_str_exists in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/fileinfo.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/fileinfo.so: undefined symbol: zend_list_close in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/ftp.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/ftp.so: undefined symbol: zend_fetch_resource2 in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/gd.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/gd.so: undefined symbol: zend_list_close in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/gettext.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/gettext.so: undefined symbol: zend_parse_arg_str_slow in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/iconv.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/iconv.so: undefined symbol: _zval_get_string_func in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/json.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/json.so: undefined symbol: _emalloc_56 in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/mbstring.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/mbstring.so: undefined symbol: zend_hash_str_del in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/mysqlnd.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/mysqlnd.so: undefined symbol: zend_hash_str_del in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/phar.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/phar.so: undefined symbol: zend_sort in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/posix.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/posix.so: undefined symbol: _zend_hash_str_update in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/shmop.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/shmop.so: undefined symbol: zend_list_close in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/simplexml.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/simplexml.so: undefined symbol: zend_ce_exception in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/sockets.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/sockets.so: undefined symbol: zend_hash_str_del in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/sqlite3.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/sqlite3.so: undefined symbol: zend_ce_exception in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/sysvmsg.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/sysvmsg.so: undefined symbol: _emalloc_64 in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/sysvsem.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/sysvsem.so: undefined symbol: _emalloc_24 in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/sysvshm.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/sysvshm.so: undefined symbol: zend_list_close in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/tidy.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/tidy.so: undefined symbol: _zend_hash_str_update in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/tokenizer.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/tokenizer.so: undefined symbol: _emalloc_large in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/xml.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/xml.so: undefined symbol: _zend_hash_str_add in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/xmlwriter.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/xmlwriter.so: undefined symbol: _emalloc_16 in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/xsl.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/xsl.so: undefined symbol: dom_node_class_entry in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/mysql.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/mysql.so: undefined symbol: mysqlnd_connect in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/mysqli.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/mysqli.so: undefined symbol: zend_ce_exception in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/pdo_mysql.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/pdo_mysql.so: undefined symbol: mysqlnd_allocator in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/pdo_sqlite.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/pdo_sqlite.so: undefined symbol: php_pdo_unregister_driver in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/wddx.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/wddx.so: undefined symbol: zend_list_close in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/xmlreader.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/xmlreader.so: undefined symbol: dom_node_class_entry in Unknown on line 0<br \/>\nPHP Warning: PHP Startup: Unable to load dynamic library &#8216;\/usr\/lib64\/php\/modules\/json.so&#8217; &#8211; \/usr\/lib64\/php\/modules\/json.so: undefined symbol: _emalloc_56 in Unknown on line 0<\/p>\n<p>Turns out DNF installed PHP 7, but didn&#8217;t do anything to remove the PHP 5 modules from my Apache configuration:<\/p>\n<p>[root@fedora01 tmp]# cd \/etc\/httpd\/modules<br \/>\n[root@fedora01 modules]# grep php *<br \/>\nBinary file libphp5.so matches<br \/>\nBinary file libphp5-zts.so matches<br \/>\nBinary file libphp7.so matches<br \/>\nBinary file libphp7-zts.so matches<\/p>\n<p>[root@fedora01 modules]# mkdir \/tmp\/oldphp<br \/>\n[root@fedora01 modules]# mv libphp5* \/tmp\/oldphp<\/p>\n<p>And remove them from the conf.modules.d too (if you just remove the module\u00a0<em>files<\/em> but try to load them in the conf.modules.d &#8230; Apache will just fail to load. You\u00a0<em>could<\/em> remove them from conf.modules.d &#8230; but I don&#8217;t want a lot of no-longer-used files sitting there to confuse me in a year or two!)<\/p>\n<p>[root@fedora01 modules]# cd \/etc\/httpd\/conf.modules.d\/<br \/>\n[root@fedora01 conf.modules.d]# grep php *<br \/>\n10-php.conf: LoadModule php5_module modules\/libphp5.so<br \/>\n10-php.conf: LoadModule php5_module modules\/libphp5-zts.so<br \/>\n15-php.conf:# Cannot load both php5 and php7 modules<br \/>\n15-php.conf:&lt;IfModule !mod_php5.c&gt;<br \/>\n15-php.conf: LoadModule php7_module modules\/libphp7.so<br \/>\n15-php.conf:&lt;IfModule !mod_php5.c&gt;<br \/>\n15-php.conf: LoadModule php7_module modules\/libphp7-zts.so<\/p>\n<p>[root@fedora01 conf.modules.d]# mv 10-php.conf \/tmp\/oldphp\/<\/p>\n<p>Then restart Apache without PHP 5:<\/p>\n<p>root@fedora01 conf.modules.d]# service httpd start<br \/>\nRedirecting to \/bin\/systemctl start httpd.service<\/p>\n<p>Voila, perfectly functioning web sites. And, yeah,\u00a0I should probably check the list of &#8220;what will be updated&#8221; when I update a server. Would save HOURS\u00a0of reading through strace output to find out old versions were still hanging about.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>TL;DR: Check the list of what is being updated before you let an OS automatically update its programs. We have a home automation \/\u00a0MythTV \/ ZoneMinder server\u00a0with automatic updates disabled.\u00a0In the process of updating OpenHAB to OpenHAB2, Scott suggested we update everything else while we&#8217;re at it. No big, did a quick &#8220;dnf update&#8221; &#8230; &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[31,161,35,166,165,164,163,162],"class_list":["post-1053","post","type-post","status-publish","format-standard","hentry","category-system-administration","tag-apache","tag-dnf-updates","tag-php","tag-php-5","tag-php-7","tag-php5","tag-php7","tag-undefined-symbol"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/1053","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1053"}],"version-history":[{"count":3,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/1053\/revisions"}],"predecessor-version":[{"id":1056,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/1053\/revisions\/1056"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}