<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>php7 &#8211; 記下來</title>
	<atom:link href="https://noter.tw/tag/php7/feed/" rel="self" type="application/rss+xml" />
	<link>https://noter.tw</link>
	<description>一路上踩到的坑、遇到的問題，一點一滴記下來，希望能幫助到需要的人~</description>
	<lastBuildDate>Tue, 03 Dec 2019 16:38:31 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.3</generator>

<image>
	<url>https://noter.tw/wp-content/uploads/cropped-old-1130742_1920-1-32x32.jpg</url>
	<title>php7 &#8211; 記下來</title>
	<link>https://noter.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Ubuntu 16.04 &#8211; phpmyadmin Deprecation Notice with PHP 7</title>
		<link>https://noter.tw/3913/ubuntu-16-04-phpmyadmin-deprecation-notice-with-php-7/</link>
					<comments>https://noter.tw/3913/ubuntu-16-04-phpmyadmin-deprecation-notice-with-php-7/#respond</comments>
		
		<dc:creator><![CDATA[黃小蛙]]></dc:creator>
		<pubDate>Mon, 04 Jun 2018 16:04:10 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[streams]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[gettext]]></category>
		<category><![CDATA[php7]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<guid isPermaLink="false">https://wazai.net/?p=3913</guid>

					<description><![CDATA[<p>這個問題之前小蛙第一次升級到 PHP 7 之後發生過一次，進到 phpmyadmin 的登入介面，就噴出一大堆錯誤警告訊息，看到這心都涼了，又有事情要忙了。 Deprecation Notice in&#46;&#46;&#46;</p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/3913/ubuntu-16-04-phpmyadmin-deprecation-notice-with-php-7/" data-wpel-link="internal">Ubuntu 16.04 &#8211; phpmyadmin Deprecation Notice with PHP 7</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>這個問題之前小蛙第一次升級到 PHP 7 之後發生過一次，進到 phpmyadmin 的登入介面，就噴出一大堆錯誤警告訊息，看到這心都涼了，又有事情要忙了。</p>



<span id="more-3913"></span>



<pre class="wp-block-preformatted wp-block-syntaxhighlighter-code">Deprecation Notice in ./../php/php-gettext/streams.php#48
Methods with the same name as their class will not be constructors in a future version of PHP; StringReader has a deprecated constructor
Backtrace
./../php/php-gettext/gettext.inc#41: require()
./libraries/select_lang.lib.php#477: require_once(./../php/php-gettext/gettext.inc)
./libraries/common.inc.php#569: require(./libraries/select_lang.lib.php)
./index.php#12: require_once(./libraries/common.inc.php) </pre>



<p>但實際上處理這問題並不難，大概 Google 了一下得到兩種答案，參考資料1 有完整 Stack Overflow 討論串，小蛙這邊自己備存：</p>



<h2 class="para wp-block-heading">重新安裝新版 phpmyadmin</h2>



<p>小蛙第一次為了減少麻煩，直接使用這個方法 (<a rel="noreferrer noopener nofollow external" href="https://stackoverflow.com/a/42178241" target="_blank" data-wpel-link="external" class="wpel-icon-right">參1<span class="wpel-icon wpel-image wpel-icon-6"></span></a>)</p>



<pre class="wp-block-preformatted wp-block-syntaxhighlighter-code">sudo apt-get remove --purge phpmyadmin php-gettext php-mbstring -y
sudo apt-get autoremove -y
sudo apt-get update
sudo apt-get install phpmyadmin php-gettext php-mbstring -y</pre>



<p>這個方法要注意安裝 phpmyadmin 的時候，會提示詢問是否要重新設定 phpmyadmin，小蛙這邊是選不要，因為小蛙想保留原始的 phpmyadmin 設定，這是特別要注意的。</p>



<h2 class="para wp-block-heading">修正出錯的檔案</h2>



<p>這個方法直接把出錯的兩支檔案抓出來修改，修改的內容分別如下：</p>



<h3 class="para wp-block-heading">修改 streams.php 檔案</h3>



<pre class="wp-block-preformatted wp-block-syntaxhighlighter-code">vim /usr/share/php/php-gettext/streams.php</pre>



<p>做以下修改</p>



<pre class="wp-block-preformatted wp-block-syntaxhighlighter-code">// 找到
function StringReader ($str='') {
// 修改成
function __construct($str='') {
// 找到
function FileReader($filename) {
// 修改成
function __construct($filename) {
// 找到
function CachedFileReader($filename) {
// 修改成
function __construct($filename) {</pre>



<h2 class="wp-block-heading" id="para">修改 gettext.php 檔案</h2>



<pre class="wp-block-preformatted wp-block-syntaxhighlighter-code">vim sudo nano /usr/share/php/php-gettext/gettext.php</pre>



<p>做以下修改</p>



<pre class="wp-block-preformatted wp-block-syntaxhighlighter-code">// 找到
function gettext_reader($Reader, $enable_cache = true) {
// 修改成
function __construct($Reader, $enable_cache = true) {</pre>



<h2 class="para wp-block-heading">參考資料</h2>



<ol class="wp-block-list"><li><a rel="noreferrer noopener nofollow external" href="https://stackoverflow.com/questions/37002494/php-7-with-phpmyadmin-gives-lots-of-deprecation-notices" target="_blank" data-wpel-link="external" class="wpel-icon-right">PHP 7 with phpmyadmin gives lots of Deprecation Notices @ Stack Overflow<span class="wpel-icon wpel-image wpel-icon-6"></span></a></li></ol>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/3913/ubuntu-16-04-phpmyadmin-deprecation-notice-with-php-7/" data-wpel-link="internal">Ubuntu 16.04 &#8211; phpmyadmin Deprecation Notice with PHP 7</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://noter.tw/3913/ubuntu-16-04-phpmyadmin-deprecation-notice-with-php-7/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
