<?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>Chris JeanChris Jean &#187; Linux</title>
	<atom:link href="http://chrisjean.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://chrisjean.com</link>
	<description>Linux, WordPress, programming, anime, and other stuff</description>
	<lastBuildDate>Mon, 16 Jan 2012 15:22:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Upgrade PHP 5.1/5.2 to 5.3 on CentOS</title>
		<link>http://chrisjean.com/2011/06/24/upgrade-php-5-1-or-5-2-to-5-3-on-centos/</link>
		<comments>http://chrisjean.com/2011/06/24/upgrade-php-5-1-or-5-2-to-5-3-on-centos/#comments</comments>
		<pubDate>Sat, 25 Jun 2011 00:25:49 +0000</pubDate>
		<dc:creator>Chris Jean</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips 'n Tricks]]></category>

		<guid isPermaLink="false">http://chrisjean.com/?p=1942</guid>
		<description><![CDATA[I&#8217;m finding that more and more software developers are being quite inconsiderate and are making code that requires PHP 5.3. Since many server-based and long-term support distros are still on PHP 5.2, this can make things difficult quickly. I&#8217;ll share how I upgraded one of my servers, but I do need to let you know [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>I&#8217;m finding that more and more software developers are being quite inconsiderate and are making code that requires PHP 5.3. Since many server-based and long-term support distros are still on PHP 5.2, this can make things difficult quickly.</p>
<p>I&#8217;ll share how I upgraded one of my servers, but I do need to let you know about some specifics about my setup as your setup may be different and require different steps to upgrade.</p>
<p>When I started, my system ran CentOS 5.5 and PHP 5.2.16. Now it is running CentOS 5.6 and PHP 5.3.3.</p>
<p>You won&#8217;t be able to follow these steps without root access, so that is definitely a requirement. I&#8217;m also running Apache. You may be using a different web server, but if you don&#8217;t know what I&#8217;m talking about, you are running Apache. I assume that if you run a different server, you will know what to change in my steps.</p>
<p><span id="more-1942"></span></p>
<h3 id="upgrade-centos">Upgrade CentOS 5.5 to CentOS 5.6</h3>
<p>I found that CentOS 5.6, released earlier this year, had package support for PHP 5.3. That made me very excited. I thought that all I needed to do was to upgrade my distro, and I would be done (I would later find that I was naïve).</p>
<p>Fortunately, upgrading CentOS is very easy. I simply ran the following command to spawn a huge amount of work for the server:</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">sudo yum update</span>
[sudo] password for user:
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * addons: mirrors.tummy.com
 * base: centos.mirror.lstn.net
 * epel: fedora-epel.mirror.lstn.net
 * extras: mirror.ubiquityservers.com
 * updates: mirror.steadfast.net
Setting up Update Process
Resolving Dependencies
--&gt; Running transaction check
---&gt; Package amtu.x86_64 0:1.0.6-2.el5 set to be updated
---&gt; Package asciidoc.noarch 0:8.6.5-1.el5.rf set to be updated
---&gt; Package audit.x86_64 0:1.7.18-2.el5 set to be updated

...

Install       5 Package(s)
Upgrade     208 Package(s)
Remove        2 Package(s)
Reinstall     0 Package(s)
Downgrade     0 Package(s)

Total download size: 309 M
Is this ok [y/N]: <span style="color: #fff;">y</span>
Downloading Packages:
(1/213): avahi-glib-0.6.16-10.el5_6.x86_64.rpm                                                                                                                                                                        |  15 kB     00:00
(2/213): avahi-glib-0.6.16-10.el5_6.i386.rpm                                                                                                                                                                          |  15 kB     00:00
(3/213): rng-utils-2.0-4.el5.x86_64.rpm                                                                                                                                                                               |  17 kB     00:00     

...

Complete!
<span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;"></span></pre>
<p>Notice the white &#8220;y&#8221; toward the bottom. Before it does anything, you must answer its question with a &#8220;y&#8221;. Just hitting enter will cancel the upgrade.</p>
<p>This will take between 5-30 minutes on average depending on the number of packages to be upgraded, the speed of your system, and your servers connection speed. So pop open a root beer and wait for everything to finish up.</p>
<h3 id="reboot">Reboot the server</h3>
<p>Since this should have installed a new <a href="http://en.wikipedia.org/wiki/Kernel_%28computing%29">kernel</a> for your system, you will want to reboot so that this new kernel can be loaded.</p>
<p>Rebooting a server can be a scary thing. Make sure that you know how to contact your hosting company&#8217;s tech support in case there are any problems with connecting to the server after the reboot. Also make sure that you notify any people that may be upset about the reboot before you do it.</p>
<h3 id="upgrade-php">Upgrade PHP 5.2 to PHP 5.3</h3>
<p>I booted up my system and found that my PHP version was not upgraded:</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">php -v</span>
PHP 5.2.11 (cli) (built: Jan 17 2011 01:47:19)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies</pre>
<p>This version of CentOS took the odd step of having both PHP 5.2 and PHP 5.3 packages. The main packages are 5.2 while another set with modified names are 5.3. For instance, the PHP 5.2 main package is <code>php</code> while the PHP 5.3 one is <code>php53</code>.</p>
<p>I still have no idea why they decided to do things this way, but I guess it has to do with some software not supporting 5.3 properly yet.</p>
<p>Since I couldn&#8217;t just install the <code>php53</code> packages as they would conflict with the <code>php</code> packages, I had to remove all the existing PHP packages and install the new ones. This meant that I had to take stock of exactly what packages I had to remove and replace.</p>
<p>I used the <code>yum</code> commands <code>list</code> command to quickly get this information:</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">yum list installed | grep php | cut -d' ' -f1</span>
php.x86_64
php-cli.x86_64
php-common.x86_64
php-devel.x86_64
php-gd.x86_64
php-mbstring.x86_64
php-mysql.x86_64
php-mcrypt.x86_64
php-pdo.x86_64
php-pear.noarch
php-pgsql.x86_64
php-xml.x86_64
php-xmlrpc.x86_64
<span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;"></span></pre>
<p>The <code>| cut -d' ' -f1</code> part at the end is just some fanciness to show only the package name and not the extra cruft.</p>
<p>Next I checked to make sure that those packages were available for <code>php53</code>:</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">yum search php53 | cut -d' ' -f1 | grep php</span>
php53.x86_64
php53-bcmath.x86_64
php53-cli.x86_64
php53-common.x86_64
php53-dba.x86_64
php53-devel.x86_64
php53-gd.x86_64
php53-imap.x86_64
php53-intl.x86_64
php53-ldap.x86_64
php53-mbstring.x86_64
php53-mysql.x86_64
php53-odbc.x86_64
php53-pdo.x86_64
php53-pgsql.x86_64
php53-process.x86_64
php53-pspell.x86_64
php53-snmp.x86_64
php53-soap.x86_64
php53-xml.x86_64
php53-xmlrpc.x86_64
<span style="color:#8FED99;">[<span style="color:#BBFF33;">use@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;"></span></pre>
<p>I quickly noticed that neither <code>php53-mcrypt.x86_64</code> nor <code>php53-pear.noarch</code> were available. I would have to install these manually.</p>
<p>First, I shut down the Apache server as I didn&#8217;t want people going to broken pages as I did these updates:</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">sudo service httpd stop</span>
Stopping httpd:                                            [  OK  ]
<span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;"></span></pre>
<p>Next, I remove the old PHP packages:</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">sudo yum remove php php-cli php-common php-devel php-gd php-mbstring \</span>
<span style="color:#FFF;"> php-mysql php-mcrypt php-pdo php-pear php-pgsql php-xml php-xmlrpc</span>
Loaded plugins: fastestmirror, priorities
Setting up Remove Process
Resolving Dependencies
--&gt; Running transaction check
---&gt; Package php.x86_64 0:5.2.16-jason.1 set to be erased

...

Remove        13 Package(s)
Reinstall     0 Package(s)
Downgrade     0 Package(s)

Is this ok [y/N]: <span style="color: #fff;">y</span>
Downloading Packages:
Running rpm_check_debug
Running Transaction Test

...

Complete!
<span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;"></span></pre>
<p>Finally, I installed the available replacement packages:</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">sudo yum install php53 php53-cli php53-common php53-devel php53-gd \</span>
<span style="color:#FFF;"> php53-mbstring php53-mysql php53-pdo php53-pgsql php53-xml php53-xmlrpc</span>
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * base: centos.mirror.lstn.net
 * epel: fedora-epel.mirror.lstn.net
 * extras: mirror.ubiquityservers.com
 * updates: mirror.steadfast.net
Setting up Install Process

...

Install       2 Package(s)
Upgrade       0 Package(s)

Total download size: 18.5 M
Is this ok [y/N]: <span style="color: #fff;">y</span>
Downloading Packages:

...

Complete!
<span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;"></span></pre>
<p>Now it&#8217;s time to get the other PHP elements that were not available as packages.</p>
<h3 id="install-php-mcrypt">Install PHP mcrypt</h3>
<p>The <code>php53-mcrypt</code> package wasn&#8217;t available, so we have to install it manually. The following steps will accomplish this.</p>
<p>We first need to install the development package for mcrypt:</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">sudo yum install php53-devel libmcrypt-devel</span>
...</pre>
<p>PHP&#8217;s mcrypt extension can be compiled and installed from the source code, so we need to download and unpackage the PHP 5.3.3 source. You can find a download link on the PHP <a href="http://us2.php.net/releases/#5.3.3">releases page</a>. I used <code>wget</code> to make the process a bit quicker:</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">wget http://museum.php.net/php5/php-5.3.3.tar.gz</span>
--2011-12-07 14:32:00--  http://museum.php.net/php5/php-5.3.3.tar.gz
Resolving museum.php.net... 67.23.255.166
Connecting to museum.php.net|67.23.255.166|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 13921529 (13M) [application/x-gzip]
Saving to: 'php-5.3.3.tar.gz'

100%[=============================================================&gt;] 13,921,529  2.04M/s   in 6.6s    

2011-06-24 19:10:40 (2.00 MB/s) - `php-5.3.3.tar.gz' saved [13921529/13921529]

<span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">tar xf php-5.3.3.tar.gz</span>
<span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;"></span></pre>
<p>Now we need to compile and install the mcrypt extension:</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">cd php-5.3.3/ext/mcrypt/</span>
<span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">mcrypt</span>]$</span> <span style="color:#FFF;">phpize</span>
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
<span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">mcrypt</span>]$</span> <span style="color:#FFF;">aclocal</span>
<span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">mcrypt</span>]$</span> <span style="color:#FFF;">./configure</span>
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc

...

checking how to hardcode library paths into programs... immediate
configure: creating ./config.status
config.status: creating config.h
<span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">mcrypt</span>]$</span> <span style="color:#FFF;">make</span>
....

Build complete.
Don't forget to run 'make test'.

<span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">mcrypt</span>]$</span> <span style="color:#FFF;">make test</span>

Build complete.
Don't forget to run 'make test'.

=====================================================================
PHP         : /usr/bin/php
PHP_SAPI    : cli
PHP_VERSION : 5.3.3
ZEND_VERSION: 2.3.0

...

Do you want to send this report now? [Yns]: <span style="color: #fff;">y</span>

Please enter your email address.
(Your address will be mangled so that it will not go out on any
mailinglist in plain text): <span style="color: #fff;">user@example.com</span>

Posting to qa.php.net /buildtest-process.php

Thank you for helping to make PHP better.
<span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">mcrypt</span>]$</span> <span style="color:#FFF;">sudo make install</span>
Installing shared extensions:     /usr/lib64/php/modules/
<span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">mcrypt</span>]$</span> <span style="color:#FFF;"></span></pre>
<p>Now all we have to do is set up the <code>mcrypt.ini</code> file so that the mcrypt extension loads with PHP. This file needs to reside at <code>/etc/php.d/mcrypt.ini</code>.</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">mcrypt</span>]$</span> <span style="color:#FFF;">echo -e "; Enable mcrypt extension module\nextension=mcrypt.so" | \</span>
<span style="color:#FFF;"> sudo tee /etc/php.d/mcrypt.ini</span>
; Enable mcrypt extension module
extension=mcrypt.so
<span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">mcrypt</span>]$</span> <span style="color:#FFF;"></span></pre>
<h3 id="install-php-pear">Install PHP Pear</h3>
<p>Finally, I need to install <a href="http://pear.php.net/">PHP Pear</a>. If you haven&#8217;t used it, it is essentially a code repository tool for easily installing, upgrading, and managing hosted code. It is basically PHP&#8217;s version of Perl&#8217;s <a href="http://www.cpan.org/">CPAN</a>.</p>
<p>Installing this is fairly straightforward.</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">wget http://pear.php.net/go-pear.phar</span>
--2011-06-24 15:18:22--  http://pear.php.net/go-pear.phar
Resolving pear.php.net... 78.129.214.25
Connecting to pear.php.net|78.129.214.25|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3680148 (3.5M) [application/octet-stream]
Saving to: `go-pear.phar'

100%[===============================================================&gt;] 3,680,148    523K/s   in 7.3s    

2011-06-24 15:18:29 (491 KB/s) - `go-pear.phar' saved [3680148/3680148]

FINISHED --2011-06-24 15:18:29--
Downloaded: 1 files, 3.5M in 7.3s (491 KB/s)
<span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">sudo php go-pear.phar </span>

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.

...

Beginning install...
PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in phar:///usr/src/go-pear.phar/PEAR/Registry.php on line 1012
PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in phar:///usr/src/go-pear.phar/PEAR/Registry.php on line 1012
PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in phar:///usr/src/go-pear.phar/PEAR/Registry.php on line 1012
PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in phar:///usr/src/go-pear.phar/PEAR/Registry.php on line 1012
Configuration written to /etc/pear.conf...
Initialized registry...

...

PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
PEAR: To install optional features use "pear install pear/PEAR#featurename"

The 'pear' command is now at your service at /usr/bin/pear
<span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;"></span></pre>
<p>Notice that ugly mess about the <code>date()</code> function. It&#8217;s PHP 5.3-specific. I posted how to fix it <a href="http://chrisjean.com/2011/06/24/php-5-3-and-system-timezone-settings/">here</a>.</p>
<h3 id="final-thoughts">Final Thoughts</h3>
<p>All in all, this was much more complex than I had anticipated. I can understand why the CentOS devs had decided to make a separate set of packages for PHP 5.3, but it really has made things difficult. I do have to warn you that many other packages will start to take issue with this setup as they will have dependency requirements for the <code>php</code> package which naturally conflicts with the <code>php53</code>. This leads me to think that they have done this in a way that the repo was not supposed to support as the dependencies should not break in this fashion.</p>
<p>Oh well. Nothing is perfect.</p>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2011/06/24/upgrade-php-5-1-or-5-2-to-5-3-on-centos/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>PHP 5.3 and &#8220;It is not safe to rely on the system&#8217;s timezone settings&#8221;</title>
		<link>http://chrisjean.com/2011/06/24/php-5-3-and-system-timezone-settings/</link>
		<comments>http://chrisjean.com/2011/06/24/php-5-3-and-system-timezone-settings/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 22:11:06 +0000</pubDate>
		<dc:creator>Chris Jean</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips 'n Tricks]]></category>

		<guid isPermaLink="false">http://chrisjean.com/?p=1936</guid>
		<description><![CDATA[I just updated one of my CentOS systems to PHP 5.3 (a chore best reserved for another blog post), and started to see the following warning popping up: PHP Notice: in file index.php on line 15: date(): It is not safe to rely on the system&#8217;s timezone settings. You are *required* to use the date.timezone [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>I just updated one of my CentOS systems to PHP 5.3 (a chore best reserved for another blog post), and started to see the following warning popping up:</p>
<blockquote><p>PHP Notice: in file index.php on line 15: date(): It is not safe to rely on the system&#8217;s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected &#8216;America/Chicago&#8217; for &#8216;CDT/-5.0/DST&#8217; instead</p></blockquote>
<p>Annoying to say the least. The fix is much easier than the message makes it seem.</p>
<p>PHP 5.3 now requires that you either have a timezone set in your php.ini file or that you pass the desired timezone via the <code>date_default_timezone_set()</code> function before calling the <code>date()</code> function.</p>
<p>I opened my server&#8217;s <code>/etc/php.ini</code> file and searched for timezone. My ini file had a section like the following:</p>
<pre>[Date]
; Defines the default timezone used by the date functions
; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
; date.timezone =</pre>
<p>I uncommented the <code>date.timezone</code> line and added the timezone I wanted.</p>
<pre>[Date]
; Defines the default timezone used by the date functions
; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
date.timezone = 'America/Chicago'</pre>
<p>There are two very important things to do in order for this to work properly for you:</p>
<ol>
<li>Use a timezone that is appropriate for your needs. Use PHP&#8217;s <a href="http://nl3.php.net/manual/en/timezones.php">List of Supported Timezones</a> to find the timezone that works for you.</li>
<li>Since your server is likely to cache the PHP configuration, you will want to restart your web server process in order for the change to be recognized. The command to execute varies by system, but for most systems, the following will work:
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">/etc</span>]$</span> <span style="color:#FFF;">sudo service httpd restart</span>
[sudo] password for user:
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
<span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">/etc</span>]$</span> <span style="color:#FFF;"></span></pre>
<p>Of course, if you are already root, you won&#8217;t need to use <code>sudo</code>:</p>
<pre class="terminal"><span style="color:#F00;">[<span style="color:#BBFF33;">root@server</span> <span style="color:#729FCF;">/etc</span>]#</span> <span style="color:#FFF;">service httpd restart</span>
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
<span style="color:#F00;">[<span style="color:#BBFF33;">root@server</span> <span style="color:#729FCF;">/etc</span>]#</span> <span style="color:#FFF;"></span></pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2011/06/24/php-5-3-and-system-timezone-settings/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>View CSV Data from the Command Line</title>
		<link>http://chrisjean.com/2011/06/17/view-csv-data-from-the-command-line/</link>
		<comments>http://chrisjean.com/2011/06/17/view-csv-data-from-the-command-line/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 14:49:52 +0000</pubDate>
		<dc:creator>Chris Jean</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips 'n Tricks]]></category>

		<guid isPermaLink="false">http://chrisjean.com/?p=1930</guid>
		<description><![CDATA[I recently wrote a script to dump data into CSV files. The CSV files work well for using in other scripts, but they are a bit difficult to read in order to verify that the data looks good. Sure, I could transfer the files to my local system and open them up in OpenOffice Spreadsheet [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>I recently wrote a script to dump data into CSV files. The CSV files work well for using in other scripts, but they are a bit difficult to read in order to verify that the data looks good. Sure, I could transfer the files to my local system and open them up in OpenOffice Spreadsheet or a similar program, but I want to do quick checks of the generated data and constantly copying the data and opening it up again in a program would just slow me down. Fortunately, there is a better way.</p>
<p>Using a combination of the <code>cat</code>, <code>column</code>, and <code>less</code> commands that are available from most *nix shells, the CSV data can be rendered into a nice table and quickly navigated. Here is an example:</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">chris@host</span> <span style="color:#729FCF;">data</span>]$</span> <span style="color:#FFF;">cat file.csv | sed -e 's/,,/, ,/g' | column -s, -t | less -#5 -N -S</span>
      1 number_of_tests  execution_time min  execution_time max  execution_time avg  execution_time std_dev  peak_memory_usage min  peak_memory_usage max  peak_memory_usage avg  peak_memory_usage std_dev  real_memory_usage min
      2 449              0.2421700954        0.2522599697        0.24422667392717    0.0013405194115834      22062656               22067696               22062951.732739        552.24028841091            22282240
      3 416              0.2449610233        0.2619900703        0.24721734340337    0.0015257664849685      21295528               21300888               21295541.019231        262.48728836508            21495808
      4 446              0.2286360264        0.2422661781        0.23043336515404    0.001174508347353       20895976               20900800               20895987.03139         228.20177111936            20971520
      5 428              0.1955471039        0.2902140617        0.1981168762521     0.0046106433816399      18045464               18048784               18045487.271028        276.98063531264            18087936
      6 436              0.2208828926        0.2558329105        0.22297720351353    0.0021463518368546      18717960               18723192               18718020.238532        557.06025400191            18874368</pre>
<p>The output is easy to navigate with the cursor keys and is perfect for quickly verifying the generated data.</p>
<p>To use for your files, simply replace <strong><code>file.csv</code></strong> in the above example with your file&#8217;s name. The <strong><code>-#5</code></strong> determines how many columns to scroll when using the left and right arrow keys. You can increase or decrease this as needed to make navigating easier.</p>
<p>For those interested, I&#8217;ve tested this on Debian-based (Ubuntu, Mint, etc) and Redhat-based (CentOS) systems, and it works on all of them.</p>
<p class="post-notice">I updated the command to fix a problem with handling empty entries, such as &#8220;&#8230;,data,,data,&#8230;&#8221;. The sed command takes care of changing those empty values to a space.</p>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2011/06/17/view-csv-data-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix &#8220;Insecure $ENV{PATH} while running setuid&#8221;</title>
		<link>http://chrisjean.com/2011/06/06/fix-insecure-envpath-while-running-setuid/</link>
		<comments>http://chrisjean.com/2011/06/06/fix-insecure-envpath-while-running-setuid/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 20:23:37 +0000</pubDate>
		<dc:creator>Chris Jean</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips 'n Tricks]]></category>

		<guid isPermaLink="false">http://chrisjean.com/?p=1923</guid>
		<description><![CDATA[Yet another tale from trying to run a Perl script with the setuid bit turned on. See my earlier post on fixing &#8220;Can’t do setuid (cannot exec sperl)&#8221; for details about why running perl scripts with setuid bits is a special case. I tried to run my script and I got the following message: [user@server [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>Yet another tale from trying to run a Perl script with the setuid bit turned on. See my earlier post on <a href="http://chrisjean.com/2011/06/06/fix-setuid-cannot-exec-sperl/">fixing &#8220;Can’t do setuid (cannot exec sperl)&#8221;</a> for details about why running perl scripts with setuid bits is a special case.</p>
<p>I tried to run my script and I got the following message:</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">run-script</span>
Insecure $ENV{PATH} while running setuid at ~/run-script line 4.</pre>
<p>The basic idea that this message is trying to get across is that an environment variable that is being used may contain data that could open up an attack vector. The way to fix this is by setting the variable to a set of defaults that don&#8217;t come from the user and thus are less susceptible to being manipulated by someone in order to break the security of the system.</p>
<p>In this case, my script executed a program on the shell. Since shell interpretation comes into play, the $PATH variable is looked at to decide where the program could be located. This is an attack vector as someone could just change that variable to cause their own code to be called, thus escalating their code&#8217;s privileges without your knowledge.</p>
<p>In order to avoid this, I set the $PATH variable to a restricted set for use in the script by adding the following in the script before my shell call:</p>
<pre class="code">$ENV{"PATH"} = "/usr/bin";</pre>
<p>This may need to be modified to meet your specific needs. In addition to making this change, I went ahead and changed the call to the shell program to be an absolute reference to the program in order to further mitigate any potential issue, such as aliases.</p>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2011/06/06/fix-insecure-envpath-while-running-setuid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix &#8220;Can&#8217;t do setuid (cannot exec sperl)&#8221;</title>
		<link>http://chrisjean.com/2011/06/06/fix-setuid-cannot-exec-sperl/</link>
		<comments>http://chrisjean.com/2011/06/06/fix-setuid-cannot-exec-sperl/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 20:03:51 +0000</pubDate>
		<dc:creator>Chris Jean</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips 'n Tricks]]></category>

		<guid isPermaLink="false">http://chrisjean.com/?p=1918</guid>
		<description><![CDATA[I recently needed to run a perl script with setuid bit set. This allows the script to run as the user the script&#8217;s file is owned by. In this case, I needed the script to run as root. Since doing this can be very dangerous, Perl does something very nice by default: If you have [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>I recently needed to run a perl script with <a href="http://en.wikipedia.org/wiki/Setuid">setuid</a> bit set. This allows the script to run as the user the script&#8217;s file is owned by. In this case, I needed the script to run as root.</p>
<p>Since doing this can be very dangerous, Perl does something very nice by default: If you have the setuid bit set on the script, it forces the script to run in <a href="http://perldoc.perl.org/perlsec.html#SECURITY-MECHANISMS-AND-CONCERNS">Taint Mode</a> which helps to ensure proper sanitation of the environment and inputs. By doing this, Perl can help lock down possible attack vectors that can compromise the security of your script. This isn&#8217;t perfect however, so I do recommend that you read up on <a href="http://perldoc.perl.org/perlsec.html#SECURITY-MECHANISMS-AND-CONCERNS">Perl&#8217;s security measures</a>.</p>
<p>So now down to the main point of this post. I tried to run the script with the setuid bit set, and I got the following error message:</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">run-script</span>
Can't do setuid (cannot exec sperl)</pre>
<p>Well that certainly puts a damper on things. Fortunately, the solution is easy. There is simply an additional package that needs to be installed to provide the wrapper program that puts this Perl security in place.</p>
<p>For Debian (Ubuntu, Mint, etc as well), run the following:</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">sudo apt-get install perl-suid</span></pre>
<p>For CentOS, run the following:</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">sudo yum install perl-suidperl</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2011/06/06/fix-setuid-cannot-exec-sperl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix &#8220;WordPress database error Table &#8230; is marked as crashed and should be repaired&#8221;</title>
		<link>http://chrisjean.com/2010/08/30/fix-wordpress-database-table-marked-crashed/</link>
		<comments>http://chrisjean.com/2010/08/30/fix-wordpress-database-table-marked-crashed/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 15:46:58 +0000</pubDate>
		<dc:creator>Chris Jean</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips 'n Tricks]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://chrisjean.com/?p=1823</guid>
		<description><![CDATA[All the content on my site was gone. When I went to investigate, I found my error log was filled with the following error: WordPress database error Table &#8216;./database_name/prefix_posts&#8217; is marked as crashed and should be repaired for query SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM prefix_posts  WHERE post_type = &#8216;post&#8217; [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>All the content on my site was gone. When I went to investigate, I found my error log was filled with the following error:</p>
<p class="code" style="padding-left: 30px;">WordPress database error Table &#8216;./database_name/prefix_posts&#8217; is marked as crashed and should be repaired for query SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM prefix_posts  WHERE post_type = &#8216;post&#8217; AND post_status = &#8216;publish&#8217; GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC  made by require, require_once, include, do_action, call_user_func_array, flexx_after_content, get_sidebar, locate_template, load_template, require_once, dynamic_sidebar, call_user_func_array, WP_Widget-&gt;display_callback, WP_Widget_Archives-&gt;widget, wp_get_archives</p>
<p>A very scary looking error, but it was easy to fix.</p>
<h3>My Preferred Repair Method</h3>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~/public_html</span>]$</span> <span style="color:#FFF;">mysql -u user -p</span>
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1120449
Server version: 5.1.48 MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

<span style="color:#8FED99;">mysql&gt;</span> <span style="color:#FFF;">connect database</span>
Connection id:    1120477
Current database: database

<span style="color:#8FED99;">mysql&gt;</span> <span style="color:#FFF;">select * from prefix_posts limit 1;</span>
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    1120568
Current database: database

ERROR 145 (HY000): Table './database/prefix_posts' is marked as crashed and should be repaired
<span style="color:#8FED99;">mysql&gt;</span> <span style="color:#FFF;">repair table prefix_posts;</span>
+-----------------------+--------+----------+----------+
| Table                 | Op     | Msg_type | Msg_text |
+-----------------------+--------+----------+----------+
| database.prefix_posts | repair | status   | OK       |
+-----------------------+--------+----------+----------+
1 row in set (3.56 sec)

<span style="color:#8FED99;">mysql&gt;</span> <span style="color:#FFF;">select * from prefix_posts limit 1;</span>
+----+-------------+---------------------+---------------------+--------------+------------+---------------+--------------+-------------+----------------+-------------+---------------+-----------+---------+--------+---------------------+---------------------+-----------------------+-------------+------------------------------------------------------------+------------+------------+----------------+---------------+
| ID | post_author | post_date           | post_date_gmt       | post_content | post_title | post_category | post_excerpt | post_status | comment_status | ping_status | post_password | post_name | to_ping | pinged | post_modified       | post_modified_gmt   | post_content_filtered | post_parent | guid                                                       | menu_order | post_type  | post_mime_type | comment_count |
+----+-------------+---------------------+---------------------+--------------+------------+---------------+--------------+-------------+----------------+-------------+---------------+-----------+---------+--------+---------------------+---------------------+-----------------------+-------------+------------------------------------------------------------+------------+------------+----------------+---------------+
| 12 |           8 | 2008-05-20 10:09:49 | 2008-05-20 15:09:49 |              | 308image1  |             0 |              | inherit     | open           | open        |               | 308image1 |         |        | 2008-05-20 10:09:49 | 2008-05-20 15:09:49 |                       |           0 | http://gaarai.com/wp-content/uploads/2008/05/308image1.gif |          0 | attachment | image/gif      |             0 |
+----+-------------+---------------------+---------------------+--------------+------------+---------------+--------------+-------------+----------------+-------------+---------------+-----------+---------+--------+---------------------+---------------------+-----------------------+-------------+------------------------------------------------------------+------------+------------+----------------+---------------+
1 row in set (0.00 sec)

<span style="color:#8FED99;">mysql&gt;</span> <span style="color:#FFF;">exit</span>
<span style="color:#FFF;">Bye</span>
<span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~/public_html</span>]$</span> <span style="color:#FFF;"></span></pre>
<p>For me, this was the easiest and quickest way to repair the table.</p>
<h3>Repairing Tables with phpMyAdmin</h3>
<p>For you, you might prefer to use phpMyAdmin. Fortunately, repairing a table with phpMyAdmin is easy.</p>
<ol>
<li>Log in to your phpMyAdmin or connect to it via your cPanel back-end.</li>
<li>Select the database with the crashed table.</li>
<li>Put a checkmark next to each crashed table.</li>
<li>Select &#8220;Repair table&#8221; from the &#8220;With selected:&#8221; drop down at the bottom of the list.</li>
<li>Let phpMyAdmin do its thing.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2010/08/30/fix-wordpress-database-table-marked-crashed/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fix PHP 4 &#8220;Client does not support authentication protocol requested by server&#8221;</title>
		<link>http://chrisjean.com/2010/05/25/fix-php-4-client-does-not-support-authentication-protocol/</link>
		<comments>http://chrisjean.com/2010/05/25/fix-php-4-client-does-not-support-authentication-protocol/#comments</comments>
		<pubDate>Tue, 25 May 2010 20:25:44 +0000</pubDate>
		<dc:creator>Chris Jean</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://gaarai.com/?p=1774</guid>
		<description><![CDATA[I&#8217;m working on building an ideal server setup that allows for both PHP 4 and PHP 5 on Apache with suPHP (I&#8217;ll blog about this later). While testing my PHP 4 build, I got the following error: Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in /var/www/test-php.php [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>I&#8217;m working on building an ideal server setup that allows for both <a href="http://php.net/">PHP</a> 4 and PHP 5 on <a href="http://www.apache.org/">Apache</a> with <a href="http://www.suphp.org/Home.html">suPHP</a> (I&#8217;ll blog about this later). While testing my PHP 4 build, I got the following error:</p>
<p style="padding-left: 30px;">Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in /var/www/test-php.php  on line 3<br />
Couldn&#8217;t authenticate with MySQL</p>
<p>The code I used to test this is quite simple:</p>
<pre>&lt;?php

if ( false === ( $db = mysql_connect( 'localhost', 'username', 'password' ) ) )
    die( "Couldn't authenticate with MySQL" );

if ( false === mysql_select_db( 'database' ) )
    die( "Couldn't connect to database" );

echo "Yay!";

?&gt;</pre>
<p>After digging around for a bit, I found that mixing PHP 4 with a MySQL version greater than or equal to 4.1 causes this problem. MySQL 4.1 introduced a new password caching scheme that PHP 4 can&#8217;t work with.</p>
<p>The solution is to update the database user&#8217;s password using the OLD_PASSWORD function of MySQL. For example:</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">chris@office</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">mysql -u root -p mysql</span>
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 267
Server version: 5.1.41-3ubuntu12.1 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

<span style="color:#8FED99;">mysql&gt;</span> <span style="color:#FFF;">update user set Password=OLD_PASSWORD('<span style="text-decoration: underline;">password</span>') WHERE User='<span style="text-decoration: underline;">username</span>';</span>
Query OK, 0 rows affected (0.02 sec)
Rows matched: 0  Changed: 0  Warnings: 0

<span style="color:#8FED99;">mysql&gt;</span> <span style="color:#FFF;">flush privileges;</span>
Query OK, 0 rows affected (0.00 sec)

<span style="color:#8FED99;">mysql&gt;</span></pre>
<p>Note the underlined areas. That is where you&#8217;ll want to provide your own username and password.</p>
<p>Once you&#8217;ve followed these steps, both PHP 4 and PHP 5 will be able to communite with the database.</p>
<p>Thanks to <a href="http://www.digitalpeer.com/id/mysql">digitalpeer</a> for providing the answer to my issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2010/05/25/fix-php-4-client-does-not-support-authentication-protocol/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MySQL ERROR 1018: Unable to Follow Symlink in Ubuntu</title>
		<link>http://chrisjean.com/2010/05/21/mysql-error-1018-unable-to-follow-symlink-in-ubuntu/</link>
		<comments>http://chrisjean.com/2010/05/21/mysql-error-1018-unable-to-follow-symlink-in-ubuntu/#comments</comments>
		<pubDate>Fri, 21 May 2010 17:40:31 +0000</pubDate>
		<dc:creator>Chris Jean</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips 'n Tricks]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[symlink]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://gaarai.com/?p=1764</guid>
		<description><![CDATA[I recently had a issue getting MySQL to read a specific database. Each time I tried to manually query a table in the database, I received the following error message: ERROR 1018 (HY000): Can't read dir of './default/' (errno: 13) I&#8217;ve seen this message before as it means that there is a permissions issue. I [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>I recently had a issue getting MySQL to read a specific database. Each time I tried to manually query a table in the database, I received the following error message:</p>
<pre>ERROR 1018 (HY000): Can't read dir of './default/' (errno: 13)</pre>
<p>I&#8217;ve seen this message before as it means that there is a permissions issue. I checked the ownerships and permissions, and everything seemed to be in order.</p>
<p>The only thing special about this database is that I have it symlinked to another partition. This has always worked in the past, so I was stumped.</p>
<p>The problem turned out to be that Ubuntu has <a href="http://en.wikipedia.org/wiki/AppArmor">AppArmor</a>. This software sets up rules that prevent software from gaining access to different areas of the file system. In my case, AppArmor was preventing read and write access to the actual location of my database files.</p>
<p>The solution was quite easy: First, I added the path that I wanted MySQL to have access to in the AppArmor configuration file for MySQL. Second, I restarted the apparmor service. Here&#8217;s the technical details:</p>
<ol>
<li>On my system, the configuration file that controls MySQL permissions through AppArmor are located at /etc/apparmor.d/usr.sbin.mysqld. The following shows the contents of the file as it now exists:
<pre># vim:syntax=apparmor
# Last Modified: Tue Jun 19 17:37:30 2007
#include 

/usr/sbin/mysqld {
  #include
  #include
  #include
  #include
  #include 

  capability dac_override,
  capability sys_resource,
  capability setgid,
  capability setuid,

  network tcp,

  /etc/hosts.allow r,
  /etc/hosts.deny r,

  /etc/mysql/*.pem r,
  /etc/mysql/conf.d/ r,
  /etc/mysql/conf.d/* r,
  /etc/mysql/my.cnf r,
  /usr/sbin/mysqld mr,
  /usr/share/mysql/** r,
  /var/log/mysql.log rw,
  /var/log/mysql.err rw,
  /var/lib/mysql/ r,
  /var/lib/mysql/** rwk,
  /var/log/mysql/ r,
  /var/log/mysql/* rw,
  /var/run/mysqld/mysqld.pid w,
  /var/run/mysqld/mysqld.sock w,
  <strong>/home/sites/default/mysql/ rw,
  /home/sites/default/mysql/* rw,</strong>

  /sys/devices/system/cpu/ r,
}</pre>
<p>The two lines in bold show what I added to the configuation. The first line gives read and write access to the directory itself while the second gives read and write access to the files contained in the directory.</li>
<li>After saving the configuration changes, I simply needed to restart the AppArmor daemon. I did this with the following command:
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">chris@rommie</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">sudo service apparmor restart</span>
 * Reloading AppArmor profiles
Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox</pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2010/05/21/mysql-error-1018-unable-to-follow-symlink-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Upgrade to Firefox 3.6 on Ubuntu 9.10</title>
		<link>http://chrisjean.com/2010/01/21/upgrade-to-firefox-3-6-on-ubuntu-9-10/</link>
		<comments>http://chrisjean.com/2010/01/21/upgrade-to-firefox-3-6-on-ubuntu-9-10/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 18:00:11 +0000</pubDate>
		<dc:creator>Chris Jean</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips 'n Tricks]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Upgrade]]></category>

		<guid isPermaLink="false">http://gaarai.com/?p=1743</guid>
		<description><![CDATA[One of my all-time most popular posts was how to upgrade to Firefox 3.5 in Ubuntu 9.04. Now it&#8217;s Firefox 3.6&#8242;s turn to be installed on my system that is now running Ubuntu 9.10. The team working on Firefox have put a ton of effort into this release and, in order to make our browsing [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>One of my all-time most popular posts was how to <a href="http://chrisjean.com/2009/07/01/upgrade-to-firefox-3-5-on-ubuntu-9-04-jaunty-jackalope/" target="_blank">upgrade to Firefox 3.5</a> in Ubuntu 9.04. Now it&#8217;s Firefox 3.6&#8242;s turn to be installed on my system that is now running Ubuntu 9.10.</p>
<p>The team working on Firefox have put a ton of effort into this release and, in order to make our browsing lives safer and faster, rolled a number of features scheduled for 3.7 into this release. Thanks for all the hard work guys.</p>
<p>Read the <a href="http://hacks.mozilla.org/2010/01/firefox-3-6-is-here/" target="_blank">3.6 release announcement</a> for details about what is new with this release.</p>
<p>So now onto the installation. Here are the commands that I ran in terminal to install 3.6.</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">chris@rommie</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">cd /tmp/</span>
<span style="color:#8FED99;">[<span style="color:#BBFF33;">chris@rommie</span> <span style="color:#729FCF;">/tmp</span>]$</span> <span style="color:#FFF;">wget "http://download.mozilla.org/?product=firefox-3.6&amp;os=linux&amp;lang=en-US"</span>
--2010-01-21 11:41:08--  http://download.mozilla.org/?product=firefox-3.6&amp;os=linux&amp;lang=en-US
Resolving download.mozilla.org... 63.245.209.58
Connecting to download.mozilla.org|63.245.209.58|:80... connected.
...

100%[=============================&gt;] 10,161,471   924K/s   in 11s     

2010-01-21 11:41:20 (899 KB/s) - `firefox-3.6.tar.bz2' saved [10161471/10161471]

<span style="color:#8FED99;">[<span style="color:#BBFF33;">chris@rommie</span> <span style="color:#729FCF;">/tmp</span>]$</span> <span style="color:#FFF;">tar xvjf firefox-*.bz2</span>
tar: Record size = 8 blocks
firefox/
firefox/update.locale
firefox/plugins/
firefox/plugins/libnullplugin.so
...
firefox/defaults/autoconfig/platform.js
firefox/defaults/autoconfig/prefcalls.js
firefox/libmozjs.so
<span style="color:#8FED99;">[<span style="color:#BBFF33;">chris@rommie</span> <span style="color:#729FCF;">/tmp</span>]$</span> <span style="color:#FFF;">sudo cp -r firefox /usr/lib/firefox-3.6</span>
[sudo] password for chris:
<span style="color:#8FED99;">[<span style="color:#BBFF33;">chris@rommie</span> <span style="color:#729FCF;">/tmp</span>]$</span> <span style="color:#FFF;">sudo mv /usr/bin/firefox /usr/bin/firefox.old</span>
<span style="color:#8FED99;">[<span style="color:#BBFF33;">chris@rommie</span> <span style="color:#729FCF;">/tmp</span>]$</span> <span style="color:#FFF;">sudo ln -s /usr/lib/firefox-3.6/firefox /usr/bin/firefox-3.6</span>
<span style="color:#8FED99;">[<span style="color:#BBFF33;">chris@rommie</span> <span style="color:#729FCF;">/tmp</span>]$</span> <span style="color:#FFF;">sudo ln -s /usr/bin/firefox-3.6 /usr/bin/firefox</span></pre>
<p>Simply run each command listed in white in your terminal to upgrade your system with the latest release version of Firefox.</p>
<p>After running these commands, close out Firefox, wait a few seconds to let everything shut down properly, and run Firefox again. If all the steps were executed properly and without error, you should be running 3.6. You can click Help &gt; About Mozilla Firefox to confirm.</p>
<p>Happy browsing.</p>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2010/01/21/upgrade-to-firefox-3-6-on-ubuntu-9-10/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Move Gnome Panels to a Different Monitor in Ubuntu</title>
		<link>http://chrisjean.com/2009/11/03/move-gnome-panels-to-a-different-monitor-in-ubuntu/</link>
		<comments>http://chrisjean.com/2009/11/03/move-gnome-panels-to-a-different-monitor-in-ubuntu/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 17:37:05 +0000</pubDate>
		<dc:creator>Chris Jean</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips 'n Tricks]]></category>
		<category><![CDATA[Dual Monitors]]></category>
		<category><![CDATA[Gnome]]></category>
		<category><![CDATA[Panels]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://gaarai.com/?p=1709</guid>
		<description><![CDATA[My dual monitor setup didn&#8217;t work properly in Ubuntu 9.04, Jaunty Jackalope. Fortunately, it does work properly in 9.10, Karmic Kaola. However, this newfound dual monitor setup has given me a new problem: how do I move my panels to the secondary monitor? My office machine is a laptop. When I get in the office, [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>My dual monitor setup didn&#8217;t work properly in Ubuntu 9.04, Jaunty Jackalope. Fortunately, it does work properly in 9.10, Karmic Kaola. However, this newfound dual monitor setup has given me a new problem: how do I move my panels to the secondary monitor?</p>
<p>My office machine is a laptop. When I get in the office, I hook it up to a 24&#8243; LCD. I&#8217;d like to use this external monitor as the primary, which means that I definitely want to have my panels display on it. However, as much as I tried to drag the panels around or play around with settings, there just didn&#8217;t seem to be a way to get them over there. However, I just figured it out.</p>
<p>By default, panels are set to expand. This means that the panels will span the entire width or height of the section of the window they occupy. If the expand option is disabled, they turn into self-sizing bar that can be dragged to different edges or centered.</p>
<p>Having the expand option disabled also allows you to grab and edge of the panel and drag it to another screen. Once on the screen you want it on, simply re-enable the expand option and you now have the panel on another screen.</p>
<p>Here&#8217;s a step-by-step way of moving a panel to another screen:</p>
<ol>
<li>Right-click the panel you wish to move and select &#8220;Properties&#8221;.</li>
<li>Uncheck the &#8220;Expand&#8221; option under the &#8220;General&#8221; tab.</li>
<li>Grab one of the edges of the panel by clicking on the left or right end (top or bottom end for vertical panels).</li>
<li>Drag the bar to the desired screen and position.</li>
<li>Check the &#8220;Expand&#8221; option in the &#8220;Panel Properties&#8221; window and click &#8220;Close&#8221;.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2009/11/03/move-gnome-panels-to-a-different-monitor-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>45</slash:comments>
		</item>
	</channel>
</rss>

