<?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 Archives - ubuntu|dog</title>
	<atom:link href="https://ubuntudog.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>https://ubuntudog.com/category/php/</link>
	<description>Knowledge is power</description>
	<lastBuildDate>Fri, 20 Dec 2024 22:25:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.1</generator>

<image>
	<url>https://media.ubuntudog.com/2019/11/cropped-favicon-32x32.png</url>
	<title>PHP Archives - ubuntu|dog</title>
	<link>https://ubuntudog.com/category/php/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to install PHP opcache</title>
		<link>https://ubuntudog.com/how-to-install-php-opcache/</link>
		
		<dc:creator><![CDATA[dean]]></dc:creator>
		<pubDate>Sun, 08 Dec 2019 15:16:15 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">https://ubuntudog.com/?p=214</guid>

					<description><![CDATA[<p>OPcache improves PHP performance by storing precompiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request. CMS frameworks such as WordPress, Joomla and Drupal, use a complex code and consume many processes. Several website speed enhancement plugins are available, heavily featured within the yield of ... <a title="How to install PHP opcache" class="read-more" href="https://ubuntudog.com/how-to-install-php-opcache/" aria-label="Read more about How to install PHP opcache">Read more</a></p>
<p>The post <a href="https://ubuntudog.com/how-to-install-php-opcache/">How to install PHP opcache</a> appeared first on <a href="https://ubuntudog.com">ubuntu|dog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>OPcache improves PHP performance by storing precompiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request.</p>
<p>CMS frameworks such as WordPress, Joomla and Drupal, use a complex code and consume many processes. Several website speed enhancement plugins are available, heavily featured within the yield of a typical search engine recommendation. Most of them do not explain how to enable opcode caching server-side – thankfully, it’s simple to implement.</p>
<p>A cursory search for ways to speed up websites will yield plugins and bolt on that only address part of the requirement. The Power Users amongst us need to know how to enable functionality server-side. This short guide will cover off the basics to get you started with OPcache on Ubuntu 18.04 with PHP 7.3 but approach is more or less the same for all Ubuntu versions.</p>
<p>For more detailed runtime options, take a look at the php.net site which has a page of all the <a href="https://www.php.net/manual/en/opcache.configuration.php">runtime options available</a>.</p>
<p>To get OPcache set up requires some changes in the php.ini file on your server.</p>
<p>Open php.ini in your favourite text editor<br />
To get started open your <strong>php.ini</strong> file. Depending on your configuration, this will be in one of two locations:</p>
<pre><strong>APACHE </strong>
sudo nano /etc/php/7.3/apache2/php.ini</pre>
<p>Or</p>
<pre><strong>NGINX </strong>
sudo nano /etc/php/7.3/fpm/php.ini</pre>
<p><strong>Enable OPcache</strong><br />
To enable the OPcache, change to the following lines of your php.ini file:</p>
<pre>;opcache.enable=0</pre>
<p>Change to:</p>
<pre>opcache.enable=1</pre>
<p>Note: Remember to uncomment this line and other configuration lines (remove the “;”) as well as change the “0″ to “1″ Otherwise your change won’t take effect.</p>
<p>Modify the amount of RAM the OPcache will use<br />
With OPcache, there is a trade-off between speed and the amount of RAM used. The more RAM you are willing to dedicate to storing opcode, the more opcode that can be stored. There is a diminishing return at some point, because some code will execute rarely, or your code base might not be that big. It is worth playing with this setting to see where you get the best performance-versus-RAM trade-off. This setting is in megabytes.</p>
<pre>;opcache.memory_consumption=64</pre>
<p>Change to:</p>
<pre>opcache.memory_consumption=128</pre>
<p>Boost the number of scripts that can be cached<br />
OPcache has a strange setting that requires you to not only adjust the amount of RAM but also define the number of scripts that can be cached. You have the option of tuning this parameter for your own application too, especially if you find that your hit rate is not close to 100 percent.</p>
<pre>;opcache.max_accelerated_files=2000</pre>
<p>Change to:</p>
<pre>opcache.max_accelerated_files=4000</pre>
<p>Change the revalidate frequency<br />
To make sure that the OPcache notices when you change your PHP code, you can set the revalidate frequency. Basically, this will tell the cache how often to check the timestamp on the files. This is measured in seconds.</p>
<pre>;opcache_revalidate_freq = 2</pre>
<p>Change to:</p>
<pre>opcache_revalidate_freq = 240</pre>
<p>Verify that the PHP OPcache mod is enabled<br />
Believe it or not, that converts most of the settings you will need to get started. PHP7 has its own module system (since 5.4), so make sure that OPcache is enabled.</p>
<pre>sudo phpenmod opcache</pre>
<p>Restart PHP<br />
You should now be all set to start using PHP 7’s OPcache. You just need to restart the appropriate service to get it going.</p>
<p>APACHE WEB SERVERS</p>
<pre>sudo service apache2 restart</pre>
<p>NGINX WEB SERVERS</p>
<pre>sudo service nginx restart</pre>
<p>The post <a href="https://ubuntudog.com/how-to-install-php-opcache/">How to install PHP opcache</a> appeared first on <a href="https://ubuntudog.com">ubuntu|dog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Manually Upgrade phpMyAdmin</title>
		<link>https://ubuntudog.com/how-to-manually-upgrade-phpmyadmin/</link>
		
		<dc:creator><![CDATA[dean]]></dc:creator>
		<pubDate>Sat, 30 Nov 2019 00:28:49 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">https://ubuntudog.com/?p=202</guid>

					<description><![CDATA[<p>Since the release of Ubuntu 18.04 and other Linux distros, many people have been having compatibility issues with PHP 7.2 and phpMyAdmin 4.6. In this article we will manually download and install the latest version of phpMyAdmin to resolve these issues. 1. Back up phpMyAdmin You should back up your current phpMyAdmin folder by renaming it. sudo ... <a title="How to Manually Upgrade phpMyAdmin" class="read-more" href="https://ubuntudog.com/how-to-manually-upgrade-phpmyadmin/" aria-label="Read more about How to Manually Upgrade phpMyAdmin">Read more</a></p>
<p>The post <a href="https://ubuntudog.com/how-to-manually-upgrade-phpmyadmin/">How to Manually Upgrade phpMyAdmin</a> appeared first on <a href="https://ubuntudog.com">ubuntu|dog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Since the release of Ubuntu 18.04 and other Linux distros, many people have been having compatibility issues with PHP 7.2 and phpMyAdmin 4.6. In this article we will manually download and install the latest version of phpMyAdmin to resolve these issues.</p>
<h2 id="1-back-up-phpmyadmin">1. Back up phpMyAdmin</h2>
<p>You should back up your current phpMyAdmin folder by renaming it.</p>
<pre class="prettyprint language-bash"><code class=" language-bash"><span class="token function">sudo</span> <span class="token function">mv</span> /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak</code></pre>
<p>Create a new phpMyAdmin folder</p>
<pre class="prettyprint language-bash"><code class=" language-bash"><span class="token function">sudo</span> <span class="token function">mkdir</span> /usr/share/phpmyadmin/</code></pre>
<p>Change to directory</p>
<pre class="prettyprint language-bash"><code class=" language-bash"><span class="token function">cd</span> /usr/share/phpmyadmin/</code></pre>
<h2 id="2-download-and-extract-phpmyadmin">2. Download and Extract phpMyAdmin</h2>
<p>Visit the <a href="https://www.phpmyadmin.net/downloads/" target="_blank" rel="noopener noreferrer">phpMyAdmin download page</a> and look for the .tar.gz URL and download it using <code>wget</code>. In this guide we are using version 4.9.1, released Sept 2019. If a later version is now available, make sure to change the commands below to match (and let me know in the comments so I can update the guide 😉).</p>
<pre class="prettyprint language-bash"><code class=" language-bash"><span class="token function">sudo</span> <span class="token function">wget</span> https://files.phpmyadmin.net/phpMyAdmin/4.9.1/phpMyAdmin-4.9.1-all-languages.tar.gz</code></pre>
<p>Now extract</p>
<pre class="prettyprint language-bash"><code class=" language-bash"><span class="token function">sudo</span> <span class="token function">tar</span> xzf phpMyAdmin-4.9.1-all-languages.tar.gz</code></pre>
<p>Once extracted, list folder</p>
<pre class="prettyprint language-bash"><code class=" language-bash"><span class="token function">ls</span></code></pre>
<p>You should see a new folder <code>phpMyAdmin-4.9.1-all-languages</code></p>
<p>We want to move the contents of this folder to <code>/usr/share/phpmyadmin</code></p>
<pre class="prettyprint language-bash"><code class=" language-bash"><span class="token function">sudo</span> <span class="token function">mv</span> phpMyAdmin-4.9.1-all-languages/* /usr/share/phpmyadmin</code></pre>
<p>You can now log back into phpMyAdmin and check the current version. You may also see two errors:</p>
<h2 id="3-edit-vendor-config-php">3. Edit vendor_config.php</h2>
<p>If you are seeing an error <em>The $cfg[‘TempDir’] (./tmp/) is not accessible. phpMyAdmin is not able to cache templates and will be slow because of this.</em></p>
<p>Open <code>vendor_config.php</code></p>
<pre class="prettyprint language-bash"><code class=" language-bash"><span class="token function">sudo</span> <span class="token function">nano</span> /usr/share/phpmyadmin/libraries/vendor_config.php</code></pre>
<p>Press <code>CTRL</code> + <code>W</code> and search for <code>TEMP_DIR</code></p>
<p>Change line  to</p>
<div class="pre-label">/usr/share/phpmyadmin/libraries/vendor_config.php</div>
<pre class="prettyprint"><code>define('TEMP_DIR', '/var/lib/phpmyadmin/tmp/');</code></pre>
<p>You may also see an error <em>The configuration file now needs a secret passphrase (blowfish_secret). </em>The blowfish secret is used by phpMyAdmin for cookie authentication. <img decoding="async" class="wp-image-2977 alignnone" src="https://devanswers.co/wp-content/uploads/2018/06/blowfish_secret.png" alt="Blowfish secret" width="20" height="18" /></p>
<p>Press <code>CTRL</code> + <code>W</code> and search for <code>CONFIG_DIR</code></p>
<p>Change line to</p>
<div class="pre-label">/usr/share/phpmyadmin/libraries/vendor_config.php</div>
<pre class="prettyprint"><code>define('CONFIG_DIR', '/etc/phpmyadmin/');</code></pre>
<p>phpMyAdmin will now generate its own blowfish secret based on the install directory.</p>
<p>Save file and exit. (Press <code>CTRL</code> + <code>X</code>, press <code>Y</code> and then press <code>ENTER</code>)</p>
<p>Now log back in to phpMyAdmin and ensure the errors are gone.</p>
<p>&nbsp;</p>
<h2 id="4-cleanup">4. Cleanup</h2>
<p>You can now delete the tar.gz file and the empty folder.</p>
<pre class="prettyprint language-bash"><code class=" language-bash"><span class="token function">sudo</span> <span class="token function">rm</span> /usr/share/phpmyadmin/phpMyAdmin-4.9.1-all-languages.tar.gz</code></pre>
<pre class="prettyprint language-bash"><code class=" language-bash"><span class="token function">sudo</span> <span class="token function">rm</span> -rf /usr/share/phpmyadmin/phpMyAdmin-4.9.1-all-languages</code></pre>
<p>And if you’re certain your new phpMyAdmin install is working correctly you can delete the backup folder.</p>
<pre class="prettyprint language-bash"><code class=" language-bash"><span class="token function">sudo</span> <span class="token function">rm</span> -rf /usr/share/phpmyadmin.bak</code></pre>
<p>Hurrah!</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The post <a href="https://ubuntudog.com/how-to-manually-upgrade-phpmyadmin/">How to Manually Upgrade phpMyAdmin</a> appeared first on <a href="https://ubuntudog.com">ubuntu|dog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Zencart &#8211; sessions directory does not exist</title>
		<link>https://ubuntudog.com/zencart-sessions-directory-does-not-exist/</link>
		
		<dc:creator><![CDATA[dean]]></dc:creator>
		<pubDate>Sat, 23 Nov 2019 22:29:32 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">http://ubuntudog.com/?p=117</guid>

					<description><![CDATA[<p>I was searching the internet after the problem that caused an error message &#8220;sessions directory does not exist&#8221; but I could not find any answer that solved my problem. I have solved this problem very easy and this message has now disappeared on my zencart shop. This kind of error message in Zencart often occures ... <a title="Zencart &#8211; sessions directory does not exist" class="read-more" href="https://ubuntudog.com/zencart-sessions-directory-does-not-exist/" aria-label="Read more about Zencart &#8211; sessions directory does not exist">Read more</a></p>
<p>The post <a href="https://ubuntudog.com/zencart-sessions-directory-does-not-exist/">Zencart &#8211; sessions directory does not exist</a> appeared first on <a href="https://ubuntudog.com">ubuntu|dog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>I was searching the internet after the problem that caused an error message &#8220;sessions directory does not exist&#8221; but I could not find any answer that solved my problem. I have solved this problem very easy and this message has now disappeared on my zencart shop. This kind of error message in Zencart often occures if you&#8217;ve changed zencart folders name. Even if you rename all variables and definitions in your both of your configuration.php files you&#8217;ll still get this error message.</p>



<p> <em>I came up with an easy solution. Edit your configuration.php files both in </em> </p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>_zen_cart_folder/includes/configuration.php and _zen_cart_folder/admin/includes/configuration.php</p></blockquote>



<p>Locate the row:<br></p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>define(&#8216;STORE_SESSIONS&#8217;, &#8221;);</p></blockquote>



<p>and change it to:<br></p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>define(&#8216;STORE_SESSIONS&#8217;, &#8216;db&#8217;);</p></blockquote>



<p>Now reload both admin and frontpage.</p>



<p>You can now change back to<br></p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>define(&#8216;STORE_SESSIONS&#8217;, &#8221;);</p></blockquote>



<p>The notice about the session directory that does not exists should now be gone.

</p>
<p>The post <a href="https://ubuntudog.com/zencart-sessions-directory-does-not-exist/">Zencart &#8211; sessions directory does not exist</a> appeared first on <a href="https://ubuntudog.com">ubuntu|dog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Nice and easy LAMP install on Ubuntu 10.04</title>
		<link>https://ubuntudog.com/nice-and-easy-lamp-install-on-ubuntu-10-04/</link>
		
		<dc:creator><![CDATA[dean]]></dc:creator>
		<pubDate>Sat, 23 Nov 2019 21:28:24 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">http://ubuntudog.com/?p=108</guid>

					<description><![CDATA[<p>This is the way to install PHP, MySQL and Apache on one command line: apt-get install apache2 php5 libapache2-mod-php5 mysql-server libapache2-mod-auth-mysql php5-mysql phpmyadmin php5-ffmpeg php5-gd php5-curl /Good luck! 😉</p>
<p>The post <a href="https://ubuntudog.com/nice-and-easy-lamp-install-on-ubuntu-10-04/">Nice and easy LAMP install on Ubuntu 10.04</a> appeared first on <a href="https://ubuntudog.com">ubuntu|dog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>

This is the way to install PHP, MySQL and Apache on one command line:</p>



<p></p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>apt-get install apache2 php5 libapache2-mod-php5 mysql-server libapache2-mod-auth-mysql php5-mysql phpmyadmin php5-ffmpeg php5-gd php5-curl</p></blockquote>



<p>/Good luck! 😉

</p>
<p>The post <a href="https://ubuntudog.com/nice-and-easy-lamp-install-on-ubuntu-10-04/">Nice and easy LAMP install on Ubuntu 10.04</a> appeared first on <a href="https://ubuntudog.com">ubuntu|dog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Packages you need to get php5-ffmpeg working</title>
		<link>https://ubuntudog.com/packages-you-need-to-get-php5-ffmpeg-working/</link>
		
		<dc:creator><![CDATA[dean]]></dc:creator>
		<pubDate>Sat, 23 Nov 2019 21:26:34 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">http://ubuntudog.com/?p=106</guid>

					<description><![CDATA[<p>Users mail me often with qestions like can you give me the list of packages that are needed to successfully convert video to flash with PHP. Here&#8217;s the list of packages you need to install to get it work: sudo apt-get install php5-ffmpeg ffmpeg flvtool2 mencoder lame</p>
<p>The post <a href="https://ubuntudog.com/packages-you-need-to-get-php5-ffmpeg-working/">Packages you need to get php5-ffmpeg working</a> appeared first on <a href="https://ubuntudog.com">ubuntu|dog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Users mail me often with qestions like can you give me the list of packages that are needed to successfully convert video to flash with PHP. Here&#8217;s the list of packages you need to install to get it work:</p>



<p></p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>sudo apt-get install php5-ffmpeg ffmpeg flvtool2 mencoder lame<br></p></blockquote>
<p>The post <a href="https://ubuntudog.com/packages-you-need-to-get-php5-ffmpeg-working/">Packages you need to get php5-ffmpeg working</a> appeared first on <a href="https://ubuntudog.com">ubuntu|dog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
