<?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>update-alternatives &#8211; 記下來</title>
	<atom:link href="https://noter.tw/tag/update-alternatives/feed/" rel="self" type="application/rss+xml" />
	<link>https://noter.tw</link>
	<description>一路上踩到的坑、遇到的問題，一點一滴記下來，希望能幫助到需要的人~</description>
	<lastBuildDate>Tue, 03 Dec 2019 16:14:30 +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>update-alternatives &#8211; 記下來</title>
	<link>https://noter.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>調整 php 版本</title>
		<link>https://noter.tw/3970/%e8%aa%bf%e6%95%b4-php-%e7%89%88%e6%9c%ac/</link>
					<comments>https://noter.tw/3970/%e8%aa%bf%e6%95%b4-php-%e7%89%88%e6%9c%ac/#respond</comments>
		
		<dc:creator><![CDATA[黃小蛙]]></dc:creator>
		<pubDate>Fri, 15 Jun 2018 11:25:05 +0000</pubDate>
				<category><![CDATA[網頁後端]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web Server]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[update-alternatives]]></category>
		<guid isPermaLink="false">https://wazai.net/?p=3970</guid>

					<description><![CDATA[<p>接續昨天處理的 swoole 編譯並且成功載入模組，今天朋友突然跟我說原本可以跑的 code 突然不能跑了 &#8230; 這就神奇了 ~~其實小蛙根本不清楚為什麼原本可以執行後來不能執行，也是因為小&#46;&#46;&#46;</p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/3970/%e8%aa%bf%e6%95%b4-php-%e7%89%88%e6%9c%ac/" data-wpel-link="internal">調整 php 版本</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></description>
										<content:encoded><![CDATA[<p>接續昨天處理的 swoole 編譯並且成功載入模組，今天朋友突然跟我說原本可以跑的 code 突然不能跑了 &#8230; 這就神奇了 ~~<br /><span id="more-3970"></span><br />其實小蛙根本不清楚為什麼原本可以執行後來不能執行，也是因為小蛙裝 Ubuntu 16.04 的時候，php5.x ~ php7.x 新舊交替，每次在想要裝 5.x 還是 7.x，看著趨勢會默默跑去裝 7.x，但有些程式直上 7.x 就是噴錯給你看，例如：<a href="https://noter.tw/3913/ubuntu-16-04-phpmyadmin-deprecation-notice-with-php-7/" data-wpel-link="internal">這篇文章</a>，這實在難啊！<br />這次這個例子呢，安裝之前小蛙並沒有注意到底是用哪一個，多 php 版本的情況下感覺好像有點自找麻煩，<del>不過感覺沒道理不過是 make swoole 就把 php cli 從 5.x 變成 7.x 版本(還是真的會這樣 &#8230;?) </del>詢問了朋友，應該是有可能在 make &amp;&amp; make install 的過程中被改掉，好吧！知道問題在哪就好處理了，如果 php cli 被改掉就 &#8230; 改回來唄！<br />調整 php 版本蠻簡單的，根據 參考資料1，小蛙這邊記錄兩種自己用的方法：</p>
<h2 class="para">手動設定 php 版本 &#8211; 1</h2>
<p>如果你很明確知道 php 的執行檔放在哪個地方，直接下指令就可以切換了</p>


<pre class="wp-block-preformatted wp-block-syntaxhighlighter-code">update-alternatives --set php /usr/bin/php5.6</pre>



<h2 class="para wp-block-heading">清單挑選 php 版本 &#8211; 2</h2>



<p>第二個方法是列出所有的 php 版本，讓你可以直接用挑選的方式設定</p>



<pre class="wp-block-preformatted wp-block-syntaxhighlighter-code">update-alternatives --config php</pre>



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



<ul class="my-li bg-darkblue wp-block-list"><li> <a rel="noreferrer noopener nofollow external" href="https://stackoverflow.com/questions/42619312/switch-php-versions-on-commandline-ubuntu-16-04" target="_blank" data-wpel-link="external" class="wpel-icon-right">Switch php versions on commandline ubuntu 16.04 @ Stack Overflow<span class="wpel-icon wpel-image wpel-icon-6"></span></a> </li></ul>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/3970/%e8%aa%bf%e6%95%b4-php-%e7%89%88%e6%9c%ac/" data-wpel-link="internal">調整 php 版本</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://noter.tw/3970/%e8%aa%bf%e6%95%b4-php-%e7%89%88%e6%9c%ac/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
