<?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>PHP | ばすにっきTips</title>
	<atom:link href="https://takabus.com/tips/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>https://takabus.com/tips</link>
	<description>プログラミングやサーバー、日々のTipsをメモしています。</description>
	<lastBuildDate>Tue, 18 Jan 2022 10:10:11 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.3</generator>

<image>
	<url>https://takabus.com/tips/wp-content/uploads/2022/12/cropped-tips-1-32x32.png</url>
	<title>PHP | ばすにっきTips</title>
	<link>https://takabus.com/tips</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>こんなに違うの!? PHPを7.2→7.3へアップデートしたらWordPressが爆速に！NextCloudもサクサク動作！</title>
		<link>https://takabus.com/tips/861/</link>
					<comments>https://takabus.com/tips/861/#respond</comments>
		
		<dc:creator><![CDATA[ばすにっきTips]]></dc:creator>
		<pubDate>Sat, 15 Jan 2022 09:08:49 +0000</pubDate>
				<category><![CDATA[サーバー]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://takabus.com/tips/?p=861</guid>

					<description><![CDATA[自宅サーバーのPHPを7.2から7.3にアップデートしたところ、WordPressやNextCloudの動作が予想以上に爆速になりましたので、感動のあまり記事をアップしました。]]></description>
										<content:encoded><![CDATA[
<p>自宅サーバーのPHPを7.2から7.3にアップデートしたところ、WordPressやNextCloudの動作が予想以上に爆速になりましたので、感動のあまり記事にしました。</p>



<div class="wp-block-cocoon-blocks-label-box-1 label-box block-box has-border-color has-yellow-border-color"><div class="label-box-label block-box-label box-label fab-pencil"><span class="label-box-label-text block-box-label-text box-label-text">自宅サーバーの環境</span></div><div class="label-box-content block-box-content box-content">
<p>自宅サーバーはRaspberry Pi 3Bです。</p>



<ul><li>CPU：ARM Cortex-A53&nbsp;</li><li>メモリ：1GB</li><li>OS：Raspbian 10（Debian）</li><li>ディスク：Crucial BX500 Series 120GB</li></ul>
</div></div>



<p>WordPressやNextCloudの動作にはラズパイ3Bでは力不足で、これまで全体的にもっさりとした動作でしたが、<span class="bold-red">PHP7.3へアップデートしたところ明らかに動作が軽くなりました。</span></p>



<h2 class="wp-block-heading">PHP7.2→7.3へ変えただけなのに・・・</h2>



<p>いや、ホントにPHPを7.2から7.3に変えただけなんです。設定なども特にいじっているわけではなく、Apacheで使用するPHPのバージョンを7.3に変更しただけで、<span class="bold-red"><span class="fz-22px"><span class="marker-under">まるで別物のように動作が軽くなりました。</span></span></span></p>



<p>もともとラズパイにはPHP7.2と7.3が共存しており、Apacheでは7.2のほうを動作させていました。しかし、NextCloudのバージョンアップを試みたところ、最新のNextCloudではPHP7.3以上が動作要件となっていたため、しかたなく7.3に切り替えたのです。</p>



<p>そしたら<span class="bold-red"><span class="fz-24px">動作が一気に爆速に！</span></span></p>



<p>試しにWordPressのダッシュボードの表示にかかる時間とNextCloudへのアクセスにかかる時間を測定してみます。</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="691" src="https://takabus.com/tips/wp-content/uploads/2022/01/image-43-1024x691.png" alt="" class="wp-image-863" srcset="https://takabus.com/tips/wp-content/uploads/2022/01/image-43-1024x691.png 1024w, https://takabus.com/tips/wp-content/uploads/2022/01/image-43-300x202.png 300w, https://takabus.com/tips/wp-content/uploads/2022/01/image-43-768x518.png 768w, https://takabus.com/tips/wp-content/uploads/2022/01/image-43.png 1060w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>WordPressのダッシュボードの表示には、これまでかなり時間がかかっていました。</figcaption></figure>



<p>これまで情報量が多いダッシュボードへのアクセスにはかなり時間がかかっていましたが、PHP7.3にしてからはおよそ半分以下にまで短縮されました。</p>



<figure class="wp-block-table aligncenter"><table><tbody><tr><td class="has-text-align-center" data-align="center">PHP</td><td class="has-text-align-center" data-align="center">WordPressダッシュボード表示に要する時間</td><td class="has-text-align-center" data-align="center">NextCloudの表示に要する時間 </td></tr><tr><td class="has-text-align-center" data-align="center">7.3</td><td class="has-text-align-center" data-align="center">8秒</td><td class="has-text-align-center" data-align="center">10秒</td></tr><tr><td class="has-text-align-center" data-align="center"><span class="bold-red">7.4</span></td><td class="has-text-align-center" data-align="center"><span class="bold-red">3秒</span></td><td class="has-text-align-center" data-align="center"><span class="bold-red">4</span><span class="bold-red">秒</span></td></tr></tbody></table><figcaption>WordPress・NextCloudのダッシュボード表示にかかる時間。パパっと表示されるようになりました！</figcaption></figure>



<figure class="wp-block-image size-full"><img decoding="async" width="967" height="659" src="https://takabus.com/tips/wp-content/uploads/2022/01/CLIP_20220115_155539.gif" alt="" class="wp-image-885"/><figcaption>ラズパイのスペックでこのスピード！かなり速いです！</figcaption></figure>



<p><span class="bold-red">さらにすごいのはここからです。</span>細かい動作はさらに顕著な高速化を遂げています。</p>



<figure class="wp-block-table aligncenter"><table><tbody><tr><td class="has-text-align-center" data-align="center">PHP</td><td class="has-text-align-center" data-align="center">記事の更新</td><td class="has-text-align-center" data-align="center">メディアライブラリの表示 </td><td class="has-text-align-center" data-align="center">投稿一覧ページの表示</td></tr><tr><td class="has-text-align-center" data-align="center">7.3</td><td class="has-text-align-center" data-align="center">7秒</td><td class="has-text-align-center" data-align="center">4秒</td><td class="has-text-align-center" data-align="center">5秒</td></tr><tr><td class="has-text-align-center" data-align="center"><span class="bold-red">7.4</span></td><td class="has-text-align-center" data-align="center"><span class="bold-red">0.5秒</span></td><td class="has-text-align-center" data-align="center"><span class="bold-red">1秒</span></td><td class="has-text-align-center" data-align="center"><span class="bold-red">2秒</span></td></tr></tbody></table><figcaption>WordPressでの各ページの表示にかかる時間も大幅に短くなりました！</figcaption></figure>



<p>これまで記事の投稿やメディアライブラリの読み込みなど、こまごまとした処理でなにかと待たされていましたが、それらの待ち時間がすべてゼロに。記事への画像の挿入もサクサク行えるようになりました。もはやx86の本格サーバーと体感速度は同じで、記事の投稿時に感じていたストレスがすっかりなくなりましたよ♪</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1005" height="715" src="https://takabus.com/tips/wp-content/uploads/2022/01/image-44.png" alt="" class="wp-image-864" srcset="https://takabus.com/tips/wp-content/uploads/2022/01/image-44.png 1005w, https://takabus.com/tips/wp-content/uploads/2022/01/image-44-300x213.png 300w, https://takabus.com/tips/wp-content/uploads/2022/01/image-44-768x546.png 768w" sizes="(max-width: 1005px) 100vw, 1005px" /></figure>



<p>また、個人的には<span class="bold-red"><span class="marker-under">NextCloudの体感速度が大幅に向上されたのも大変嬉しいところです。</span></span>ファイルの一覧表示にかなりの時間がかかっており、フォルダをタップするたびに待たされるのでかなりストレスだったのですが、PHPのバージョンを上げてからはサクサク表示されるようになりました。これはかなりありがたい！</p>



<p>このほかLaravelで開発したWebアプリもパフォーマンスがめちゃくちゃ上がりました。<strong>たった0.1の違い</strong>で、こんなに大きく変わるとは。驚きです。</p>



<h2 class="wp-block-heading">PHPは定期的なアップデートを！幸せになれるかも！</h2>



<p>これまで安定性重視のあまり、PHPのアップデートには消極的でした。</p>



<p>しかし、今回のことを機にこれからはPHPのアップデートもちゃんとしていくつもりです。なにせバージョンアップだけでここまで変貌を遂げてくれるのですからね。追加コスト無しで明らかに快適に使用できるようになりました。セキュリティ的にも定期的なアップデートはやるべきでしょう。</p>



<p>さっそくほかの自宅サーバーもアップデートしてみたいと思います。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://takabus.com/tips/861/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
