<?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>Tequila Fish &#187; PHP</title>
	<atom:link href="http://www.tequilafish.com/category/tech/programming/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tequilafish.com</link>
	<description>Ran-dumb ramblings of me...</description>
	<lastBuildDate>Thu, 26 Jan 2012 23:30:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>eAccelerator and open_basedir: open_basedir restriction in effect. File() is not within the allowed path(s):</title>
		<link>http://www.tequilafish.com/2010/07/22/eaccelerator-and-open_basedir-open_basedir-restriction-in-effect-file-is-not-within-the-allowed-paths/</link>
		<comments>http://www.tequilafish.com/2010/07/22/eaccelerator-and-open_basedir-open_basedir-restriction-in-effect-file-is-not-within-the-allowed-paths/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 22:48:46 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.tequilafish.com/?p=417</guid>
		<description><![CDATA[After installing eAccelerator on a CentOS 5.5 server running PHP 5.2.10, a bunch of websites began failing with open_basedir errors like so: [Fri Jul 16 17:53:50 2010] [error] [client XX.XX.XXX.XXX] PHP Warning: require() [function.require]: open_basedir restriction in effect. File() is not within the allowed path(s): (/home/username/) in /home/username/public_html/wp-settings.php on line 19, referer: http://www.server.com/ After doing [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.tequilafish.com%2F2010%2F07%2F22%2Feaccelerator-and-open_basedir-open_basedir-restriction-in-effect-file-is-not-within-the-allowed-paths%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.tequilafish.com%2F2010%2F07%2F22%2Feaccelerator-and-open_basedir-open_basedir-restriction-in-effect-file-is-not-within-the-allowed-paths%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>After installing <a href="http://eaccelerator.net/">eAccelerator</a> on a CentOS 5.5 server running PHP 5.2.10, a bunch of websites began failing with open_basedir errors like so:</p>
<p><code>[Fri Jul 16 17:53:50 2010] [error] [client XX.XX.XXX.XXX] PHP Warning:  require() [<a href='function.require'>function.require</a>]: open_basedir restriction in effect. File() is not within the allowed path(s): (/home/username/) in /home/username/public_html/wp-settings.php on line 19, referer: http://www.server.com/</code></p>
<p>After doing some research it turns out that a default option that is compiled into eAccelerator is incompatible with open_basedir.  The fix is easy enough, simply re-compile with the <strong>--without-eaccelerator-use-inode</strong> option like so:</p>
<p><code>make clean<br />
phpize<br />
./configure --without-eaccelerator-use-inode<br />
make<br />
make install</code></p>
<p>After re-compiling and installing, make sure you clear out the existing eAccelerator files before restarting Apache:</p>
<p><code>rm -rf /var/cache/eaccelerator/*<br />
apachectl restart</code></p>
<p>eAccelerator states that the next version will have this compile option set by default.</p>
<p>Reference:</p>
<ul>
<li><a href="http://eaccelerator.net/ticket/414">http://eaccelerator.net/ticket/414</a></li>
<li><a href="http://eaccelerator.net/ticket/104">http://eaccelerator.net/ticket/104</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.tequilafish.com/2010/07/22/eaccelerator-and-open_basedir-open_basedir-restriction-in-effect-file-is-not-within-the-allowed-paths/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP: How to capture output of echo into a local variable.</title>
		<link>http://www.tequilafish.com/2009/02/10/php-how-to-capture-output-of-echo-into-a-local-variable/</link>
		<comments>http://www.tequilafish.com/2009/02/10/php-how-to-capture-output-of-echo-into-a-local-variable/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 02:53:40 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[buffer]]></category>
		<category><![CDATA[echo]]></category>
		<category><![CDATA[print]]></category>

		<guid isPermaLink="false">http://www.tequilafish.com/?p=209</guid>
		<description><![CDATA[I've been customizing a WordPress install and have been needing to capture the output of the bloginfo() function, which simply echo's a string. I wanted to capture the echo into a variable without actually echo'ing the string. You can do so by leveraging PHP's output buffering functions. Here's how you do it: ob_start(); echo 'Hello [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.tequilafish.com%2F2009%2F02%2F10%2Fphp-how-to-capture-output-of-echo-into-a-local-variable%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.tequilafish.com%2F2009%2F02%2F10%2Fphp-how-to-capture-output-of-echo-into-a-local-variable%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I've been customizing a WordPress install and have been needing to capture the output of the <tt>bloginfo()</tt> function, which simply echo's a string.  I wanted to capture the echo into a variable without actually echo'ing the string.  You can do so by leveraging PHP's output buffering functions.  Here's how you do it:</p>
<p><code>ob_start();<br />
echo 'Hello World';<br />
$myStr = ob_get_contents();<br />
ob_end_clean();</code></p>
<p><tt>$myStr</tt> will now contain '<tt>Hello World</tt>' without actually outputting it to the screen.</p>
<p>Reference:</p>
<ul>
<li><a href="http://www.php.net/ob_start">ob_start()</a></li>
<li><a href="http://www.php.net/ob_get_contents">ob_get_contents()</a></li>
<li><a href="http://www.php.net/ob_end_clean">ob_end_clean()</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.tequilafish.com/2009/02/10/php-how-to-capture-output-of-echo-into-a-local-variable/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>FCKEditor: Remove &amp; prevent &lt;p&gt; tags from wrapping your content.</title>
		<link>http://www.tequilafish.com/2008/09/12/fckeditor-remove-p-tags-from-wrapping-your-content/</link>
		<comments>http://www.tequilafish.com/2008/09/12/fckeditor-remove-p-tags-from-wrapping-your-content/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 19:54:02 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[FCKeditor]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.tequilafish.com/?p=139</guid>
		<description><![CDATA[For some reason, FCKEditor automatically wraps any content entered into the textbox with a &#60;p&#62; tag. This can cause for some problems in your layout when you're actually displaying the content. Instead of trying to fix this in your layout with CSS, there is a quick and easy way to turn the auto-wrap off in [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.tequilafish.com%2F2008%2F09%2F12%2Ffckeditor-remove-p-tags-from-wrapping-your-content%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.tequilafish.com%2F2008%2F09%2F12%2Ffckeditor-remove-p-tags-from-wrapping-your-content%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>For some reason, <a href="http://www.fckeditor.net/">FCKEditor</a> automatically wraps any content entered into the textbox with a &lt;p&gt; tag.  This can cause for some problems in your layout when you're actually displaying the content.  Instead of trying to fix this in your layout with CSS, there is a quick and easy way to turn the auto-wrap off in FCKEditor: Change the <strong><tt>FCKConfig.EnterMode</tt></strong> setting from <strong>'p'</strong> to <strong>'br'</strong>.  There are a few ways to handle this:</p>
<ul>
<li>Edit <tt>fckconfig.js</tt>:<br />Change <strong><tt>FCKConfig.EnterMode = 'p';</tt></strong> to <strong><tt>FCKConfig.EnterMode = 'br';</tt></strong></li>
<li>Change the setting programatically when you instantiate the object, like so (in PHP):<br />
<code>&lt;?php<br />
		include_once('fckeditor/fckeditor.php');<br />
		$oFCKeditor = new FCKeditor('description');<br />
		$oFCKeditor->BasePath = '/fckeditor/';<br />
		$oFCKeditor->Value = 'some text';<br />
		<strong>$oFCKeditor->Config['EnterMode'] = 'br'; // turn off auto &lt;p&gt; tags wrapping content</strong><br />
		$oFCKeditor->Create();<br />
		?&gt;</code></li>
</ul>
<p>I prefer the latter way because you can do it on a page by page basis, and there's no messing with FCK's core JavaScript files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tequilafish.com/2008/09/12/fckeditor-remove-p-tags-from-wrapping-your-content/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP &amp; ionCube Loader: &#8216;The Loader must appear as the first entry in the php.ini file in Unknown on line 0&#8242;</title>
		<link>http://www.tequilafish.com/2008/02/18/php-ioncube-loader-the-loader-must-appear-as-the-first-entry-in-the-phpini-file-in-unknown-on-line-0/</link>
		<comments>http://www.tequilafish.com/2008/02/18/php-ioncube-loader-the-loader-must-appear-as-the-first-entry-in-the-phpini-file-in-unknown-on-line-0/#comments</comments>
		<pubDate>Mon, 18 Feb 2008 23:00:29 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[ioncube]]></category>
		<category><![CDATA[loader]]></category>
		<category><![CDATA[optimizer]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.tequilafish.com/2008/02/18/php-ioncube-loader-the-loader-must-appear-as-the-first-entry-in-the-phpini-file-in-unknown-on-line-0/</guid>
		<description><![CDATA[I received the following in my Apache error_log when attempting to load the ionCube loader in my php.ini file: PHP Fatal error: [ionCube Loader] The Loader must appear as the first entry in the php.ini file in Unknown on line 0 This is because ionCube must be loaded before any of the Zend extensions are. [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.tequilafish.com%2F2008%2F02%2F18%2Fphp-ioncube-loader-the-loader-must-appear-as-the-first-entry-in-the-phpini-file-in-unknown-on-line-0%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.tequilafish.com%2F2008%2F02%2F18%2Fphp-ioncube-loader-the-loader-must-appear-as-the-first-entry-in-the-phpini-file-in-unknown-on-line-0%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I received the following in my Apache error_log when attempting to load the ionCube loader in my php.ini file:</p>
<p><code>PHP Fatal error:  [ionCube Loader] The Loader must appear as the first entry in the php.ini file in Unknown on line 0</code></p>
<p>This is because ionCube must be loaded before any of the Zend extensions are.  So if you have the Zend extension/optimizer loaded, your php.ini should look like this to get ionCube to work:</p>
<p><code>[Zend]<br />
zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.1.so<br />
zen_extension_ts=/usr/local/ioncube/ioncube_loader_lin_5.1_ts.so<br />
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.0<br />
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.0<br />
zend_optimizer.version=3.3.0a<br />
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so<br />
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so</code></p>
<p>----------------<br />
Now playing: <a href="http://www.foxytunes.com/artist/tommy+mccook+%26+the+aggrovators/track/a+loving+melody">Tommy McCook &#038; The Aggrovators - A Loving Melody</a><br />
via <a href="http://www.foxytunes.com/signatunes/">FoxyTunes</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tequilafish.com/2008/02/18/php-ioncube-loader-the-loader-must-appear-as-the-first-entry-in-the-phpini-file-in-unknown-on-line-0/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>mod_rewrite &amp; PHP: How to match urlencoded plus sign (+ = %2B)</title>
		<link>http://www.tequilafish.com/2007/12/06/mod_rewrite-php-how-to-match-urlencoded-plus-sign/</link>
		<comments>http://www.tequilafish.com/2007/12/06/mod_rewrite-php-how-to-match-urlencoded-plus-sign/#comments</comments>
		<pubDate>Fri, 07 Dec 2007 05:37:21 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[%2b]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[plus]]></category>
		<category><![CDATA[urlencode]]></category>

		<guid isPermaLink="false">http://www.tequilafish.com/2007/12/06/mod_rewrite-php-how-to-match-urlencoded-plus-sign-%2b/</guid>
		<description><![CDATA[I ran into trouble when trying to pass a urlencode()'ed plus sign into a web address being processed by mod_rewrite. $url = 'http://www.server.com/browsealpha/name+has+plus+in+it/'; $url = urlencode($url); // http://www.server.com/browsealpha/name%2Bhas%2Bplus%2Bin%2Bit/ This $url variable gets echo()'d as a link in a page, so once it's clicked and loaded in the browser, I then needed mod_rewrite to translate that [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.tequilafish.com%2F2007%2F12%2F06%2Fmod_rewrite-php-how-to-match-urlencoded-plus-sign%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.tequilafish.com%2F2007%2F12%2F06%2Fmod_rewrite-php-how-to-match-urlencoded-plus-sign%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I ran into trouble when trying to pass a <a href="http://us.php.net/urlencode"><tt>urlencode()</tt></a>'ed plus sign into a web address being processed by mod_rewrite.</p>
<p><code>$url = 'http://www.server.com/browsealpha/name+has+plus+in+it/';<br />
$url = urlencode($url); // http://www.server.com/browsealpha/name%2Bhas%2Bplus%2Bin%2Bit/</code></p>
<p>This <tt>$url</tt> variable gets <tt>echo()</tt>'d as a link in a page, so once it's clicked and loaded in the browser, I then needed mod_rewrite to translate that to the actual URL, which is:</p>
<p><code>http://www.server.com/browsealpha.php?name=name%2Bhas%2Bplus%2Bin%2Bit</code></p>
<p>Here is the RewriteRule I was using to match:</p>
<p><code># match any name containing any combination of letters, numbers, and the % sign (to match urlencoded URLs)<br />
RewriteRule ^browsealpha/([%\w]*)/?$ /browsealpha.php?name=$1 [QSA,L]</code></p>
<p>This rule should match <tt>http://www.server.com/browsealpha/name%2Bhas%2Bplus%2Bin%2Bit/</tt> but for some reason it wouldn't work.  After hours of frustration, I found <a href="http://cssbeauty.com/skillshare/discussion/2311/">a</a> <a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=34602">few</a> <a href="http://us.php.net/urlencode">threads</a> mentioning the need to <tt>urlencode()</tt> the string <strong>twice</strong>, like so:</p>
<p><code>urlencode(urlencode($variable));</code></p>
<p>IT WORKS!!!  Apparently this is because mod_rewrite automatically decodes the urlencoded URL, so if you pass in <tt>%2B</tt>, PHP sees it as <tt>%2B0</tt>.  If you double encode, mod_rewrite decodes the first one, and PHP receives the second one (which is now <tt>%2B</tt>, which is what we want).</p>
<p>----------------<br />
Now playing: <a href="http://www.foxytunes.com/artist/autechre/track/444">Autechre - 444</a><br />
via <a href="http://www.foxytunes.com/signatunes/">FoxyTunes</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tequilafish.com/2007/12/06/mod_rewrite-php-how-to-match-urlencoded-plus-sign/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>PHP &amp; imagettftext with Webcore TrueType fonts.</title>
		<link>http://www.tequilafish.com/2007/07/21/php-imagettftext-with-webcore-truetype-fonts/</link>
		<comments>http://www.tequilafish.com/2007/07/21/php-imagettftext-with-webcore-truetype-fonts/#comments</comments>
		<pubDate>Sat, 21 Jul 2007 21:37:12 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[imagegettftext]]></category>
		<category><![CDATA[truetype]]></category>
		<category><![CDATA[webcore]]></category>

		<guid isPermaLink="false">http://www.tequilafish.com/2007/07/21/php-imagettftext-with-webcore-truetype-fonts/</guid>
		<description><![CDATA[If you're trying to write some text using PHP/GD &#038; the imagettftext() function, you will of course need some TrueType fonts to work with. I've found a great set of fonts available for free: Webcore. Webcore contains all the fonts web designers constantly use, things like Arial, Tahoma, Verdana, Georgia, etc.. To install, simply download [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.tequilafish.com%2F2007%2F07%2F21%2Fphp-imagettftext-with-webcore-truetype-fonts%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.tequilafish.com%2F2007%2F07%2F21%2Fphp-imagettftext-with-webcore-truetype-fonts%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>If you're trying to write some text using PHP/GD &#038; the <tt>imagettftext()</tt> function, you will of course need some TrueType fonts to work with.  I've found a great set of fonts available for free: <a href="http://avi.alkalay.net/software/webcore-fonts/">Webcore</a>.  Webcore contains all the fonts web designers constantly use, things like Arial, Tahoma, Verdana, Georgia, etc..</p>
<p>To install, simply download to your server and install the RPM (Fedora):<br />
<code>shell&gt; wget http://avi.alkalay.net/software/webcore-fonts/webcore-fonts-3.0-1.noarch.rpm<br />
shell&gt; rpm -i webcore-fonts-3.0-1.noarch.rpm</code></p>
<p>These fonts will now be available to you in <strong><tt>/usr/share/fonts/webcore/</tt></strong>.</p>
<p>Make sure you specify the full path when calling <tt>imagettftext()</tt>, eg:<br />
<code>&lt;?php<br />
&nbsp;<br />
// Set the content-type<br />
header("Content-type: image/png");<br />
&nbsp;<br />
// Replace path by your own font path<br />
$font = '/usr/share/fonts/webcore/arial.ttf';<br />
&nbsp;<br />
// Create the image<br />
$im = imagecreatetruecolor(400, 30);<br />
&nbsp;<br />
// Create some colors<br />
$white = imagecolorallocate($im, 255, 255, 255);<br />
$black = imagecolorallocate($im, 0, 0, 0);<br />
imagefilledrectangle($im, 0, 0, 399, 29, $white);<br />
&nbsp;<br />
// The text to draw<br />
$text = 'Hello world!';<br />
&nbsp;<br />
// Add some text<br />
imagettftext($im, 20, 0, 10, 20, $black, $font, $text);<br />
&nbsp;<br />
// Using imagepng() results in clearer text compared with imagejpeg()<br />
imagepng($im);<br />
imagedestroy($im);<br />
?&gt;</code></p>
<p>Your mileage may vary if you are using a different distribution, but the docs state that this RPM should work on other distros.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tequilafish.com/2007/07/21/php-imagettftext-with-webcore-truetype-fonts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cookies with PHP&#8217;s setcookie() and Safari</title>
		<link>http://www.tequilafish.com/2007/03/27/cookies-with-phps-setcookie-and-safari/</link>
		<comments>http://www.tequilafish.com/2007/03/27/cookies-with-phps-setcookie-and-safari/#comments</comments>
		<pubDate>Tue, 27 Mar 2007 22:46:01 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[cookie]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[setcookie]]></category>

		<guid isPermaLink="false">http://www.tequilafish.com/2007/03/27/cookies-with-phps-setcookie-and-safari/</guid>
		<description><![CDATA[I've come across a little inconsistency between browsers and the way they handle cookies. Using the examples from PHP's online manual, I was unable to get Safari to remove cookies using setcookie(). All other browsers would clear the cookie with no problems. It turns out that Safari will only delete cookies if both the cookie [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.tequilafish.com%2F2007%2F03%2F27%2Fcookies-with-phps-setcookie-and-safari%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.tequilafish.com%2F2007%2F03%2F27%2Fcookies-with-phps-setcookie-and-safari%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I've come across a little inconsistency between browsers and the way they handle cookies.  Using the <a href="http://us3.php.net/manual/en/function.setcookie.php">examples</a> from PHP's online manual, I was unable to get Safari to remove cookies using <tt>setcookie()</tt>.  All other browsers would clear the cookie with no problems.  It turns out that Safari will only delete cookies if both the cookie name AND the cookie path match.  </p>
<p>In other words, this won't work:</p>
<p><code>setcookie('TestCookie', 'somevalue', time()+3600, '/somepath/'); // Set cookie<br />
setcookie('TestCookie', '', time()-3600); // Delete cookie</p>
<p>But this <em>will</em> work:</p>
<p></code><code>setcookie('TestCookie', 'somevalue', time()+3600, '/somepath/'); // Set cookie<br />
setcookie('TestCookie', '', time()-3600, '/somepath/'); // Delete cookie</code></p>
<p>Basically, if you set a cookie using a path, you must also specify the path when deleting the cookie.  Safari won't remove the cookie otherwise.  This is probably a good thing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tequilafish.com/2007/03/27/cookies-with-phps-setcookie-and-safari/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Squirrelmail and Very Large (Big-Ass) Inboxes</title>
		<link>http://www.tequilafish.com/2007/02/20/squirrelmail-and-very-large-big-ass-inboxes/</link>
		<comments>http://www.tequilafish.com/2007/02/20/squirrelmail-and-very-large-big-ass-inboxes/#comments</comments>
		<pubDate>Tue, 20 Feb 2007 22:14:15 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[memory_limit]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[squirrelmail]]></category>

		<guid isPermaLink="false">http://www.tequilafish.com/2007/02/20/squirrelmail-and-very-large-big-ass-inboxes/</guid>
		<description><![CDATA[We have an account with a VERY large inbox (over 80,000 emails), and when logging into Squirrelmail the main pane would not load. Instead we'd be prompted by the browser to download a right_main.php file. Accounts with smaller inboxes would load fine, so I figured it had something to do with system resources. This is [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.tequilafish.com%2F2007%2F02%2F20%2Fsquirrelmail-and-very-large-big-ass-inboxes%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.tequilafish.com%2F2007%2F02%2F20%2Fsquirrelmail-and-very-large-big-ass-inboxes%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>We have an account with a VERY large inbox (over 80,000 emails), and when logging into <a href="http://www.squirrelmail.org/">Squirrelmail</a> the main pane would not load. Instead we'd be prompted by the browser to download a <strong><tt>right_main.php</tt></strong> file.  Accounts with smaller inboxes would load fine, so I figured it had something to do with system resources.  This is an easy fix.  Open up your <strong><tt>php.ini</tt></strong> file, and increase the <strong><tt>memory_limit</tt></strong> value to something larger than the default <tt>8M</tt>.  Restart Apache and try opening your big-ass inbox again.  If it still doesn't work, increase <tt>memory_limit</tt> again.  Repeat until your inbox will load, but be careful if you have little RAM.  I was able to load my 80,000+ inbox by setting <strong><tt>memory_limit = 32M</tt></strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tequilafish.com/2007/02/20/squirrelmail-and-very-large-big-ass-inboxes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing PDFlib Lite as a PHP module on Fedora Core 4</title>
		<link>http://www.tequilafish.com/2006/05/23/installing-pdflib-lite-as-a-php-module-on-fedora-core-4/</link>
		<comments>http://www.tequilafish.com/2006/05/23/installing-pdflib-lite-as-a-php-module-on-fedora-core-4/#comments</comments>
		<pubDate>Tue, 23 May 2006 23:15:21 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[pdflib]]></category>
		<category><![CDATA[redhat]]></category>

		<guid isPermaLink="false">http://www.tequilafish.com/2006/05/23/installing-pdflib-lite-as-a-php-module-on-fedora-core-4/</guid>
		<description><![CDATA[The instructions for doing so (here) seemed straightforward enough, but I ran into a few problems. So here's how I got PDFLib working with my PHP install on Fedora Core 4. First we need to build PDFlib Lite from Source. Download it from here. Unpack it, then: ./configure make make install Easy enough. Now: yum [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.tequilafish.com%2F2006%2F05%2F23%2Finstalling-pdflib-lite-as-a-php-module-on-fedora-core-4%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.tequilafish.com%2F2006%2F05%2F23%2Finstalling-pdflib-lite-as-a-php-module-on-fedora-core-4%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>The instructions for doing so (<a href="http://www.pdflib.com/products/pdflib/info/PDFlib-in-PHP-HowTo.pdf">here</a>) seemed straightforward enough, but I ran into a few problems.  So here's how I got PDFLib working with my PHP install on Fedora Core 4.</p>
<p>First we need to build PDFlib Lite from Source.  Download it from <a href="http://www.pdflib.com/products/pdflib/download-source.html">here</a>.  Unpack it, then:<br />
<code>./configure<br />
make<br />
make install</code><br />
Easy enough.  Now:<br />
<code>yum install automake<br />
yum install php-devel<br />
pecl install pdflib</code><br />
(Note: <tt>php-devel</tt> is required because we need <strong><tt>phpize</tt></strong> which is used by the <tt>pecl</tt> command.)</p>
<p>The PECL install will ask you a question: "Path to PDFlib installation?"  This is where I ran into problems.  You must put <strong><tt>/usr/local/</tt></strong> and NOT <strong><tt>/usr/local/include</tt></strong> because the script is hardcoded to look inside the include directory automatically.  Once PECL finds <tt>pdflib.h</tt> it will continue and finish compiling our shared object, <strong><tt>pdf.so</tt></strong>.  The script will install it for us in <strong><tt>/usr/lib/php/modules/</tt></strong><br />
Now we just have to tell PHP to load the SO.  Open up <tt>php.ini</tt> and add the following line:<br />
<code>extension=pdf.so</code><br />
Save &#038; exit, and restart your Apache with <strong><tt>apachectl graceful</tt></strong>.  Now browse to a file containing the <tt>phpinfo()</tt> function and check to see if PDFlib is now active.  If you see it, you're good to go!</p>
<p><strong>NOTE:</strong> I ran into a problem with RPM GPG Keys at the <tt>automake install</tt> step.  I was getting the following error:<br />
<code>warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID db42a60e<br />
public key not available for autoconf-2.59-5.noarch.rpm<br />
Retrieving GPG key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora<br />
The GPG key at file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora (0x4F2A6FD2)<br />
is already installed but is not the correct key for this package.<br />
Check that this is the correct key for the "Fedora Core 4 - i386 - Base" repository.</code><br />
To get around this we need to import all the keys by run the following command:<br />
<code>rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*</code><br />
I found this solution in <a href="http://www.redhat.com/archives/fedora-maintainers/2005-July/msg00070.html">this thread</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tequilafish.com/2006/05/23/installing-pdflib-lite-as-a-php-module-on-fedora-core-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Xdebug &amp; phpize for PHP on FreeBSD</title>
		<link>http://www.tequilafish.com/2005/08/22/xdebug-phpize-for-php-on-freebsd/</link>
		<comments>http://www.tequilafish.com/2005/08/22/xdebug-phpize-for-php-on-freebsd/#comments</comments>
		<pubDate>Mon, 22 Aug 2005 23:41:53 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.tequilafish.com/2005/08/22/xdebug-phpize-for-php-on-freebsd/</guid>
		<description><![CDATA[I ran into a few problems trying to install Xdebug into PHP on both FreeBSD 5.2 and FreeBSD 5.4. My research led me to this PHP bug thread and the proper solution. Here's a quick summary to get you going with Xdebug: Xdebug is installed via phpize, and phpize has some requirements: autoconf: 2.13 automake: [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.tequilafish.com%2F2005%2F08%2F22%2Fxdebug-phpize-for-php-on-freebsd%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.tequilafish.com%2F2005%2F08%2F22%2Fxdebug-phpize-for-php-on-freebsd%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I ran into a few problems trying to install Xdebug into PHP on both FreeBSD 5.2 and FreeBSD 5.4.  My research led me to <a href="http://pecl.php.net/bugs/bug.php?id=3538">this PHP bug thread</a> and the proper solution.  Here's a quick summary to get you going with Xdebug:</p>
<p>Xdebug is installed via phpize, and phpize has some <a href="http://www.php.net/anoncvs.php">requirements</a>:</p>
<ul>
<li>autoconf: 2.13</li>
<li>automake: 1.4+</li>
<li>libtool: 1.4.x+ (except 1.4.2)</li>
<li>bison: 1.28 (preferred), 1.35, or 1.75</li>
<li>flex: 2.5.4</li>
</ul>
<p>I was able to get mine up and running with the following versions:</p>
<ul>
<li>autoconf: 2.59_2</li>
<li>automake: 1.9.5</li>
<li>libtool: 1.5.10_1</li>
<li>bison: 1.75_2</li>
<li>flex: 2.5.4</li>
</ul>
<p>However, the ports packages for autoconf, automake, and libtool that come with FreeBSD are installed into non-standard locations, so phpize is unable to find them.  This is easily fixed with symlinks (NOTE: symlinks will vary depending on which versions you have installed):<br />
<code>ln -s /usr/local/bin/aclocal19 /usr/local/bin/aclocal<br />
ln -s /usr/local/bin/automake19 /usr/local/bin/automake<br />
ln -s /usr/local/bin/autoconf259 /usr/local/bin/autoconf<br />
ln -s /usr/local/bin/autoheader259 /usr/local/bin/autoheader<br />
ln -s /usr/local/bin/libtool15 /usr/local/bin/libtool<br />
ln -s /usr/local/bin/libtoolize15 /usr/local/bin/libtoolize<br />
ln -s /usr/local/share/aclocal19/ /usr/local/share/aclocal<br />
ln -s /usr/local/share/aclocal19/libtool15.m4 /usr/local/share/aclocal19/libtool.m4</code><br />
Now, assuming you have all the correct versions installed and paths present, phpize should be able to find everything and Xdebug should install as expected:<br />
<code># phpize<br />
# ./configure --enable-xdebug<br />
# make<br />
# cp modules/xdebug.so /usr/local/lib/php/extensions</code></p>
<ul>
<li>Add the following to <tt>php.ini</tt>:<br />
   <code>zend_extension=&quot;/usr/local/lib/php/extensions/xdebug.so&quot;</code></li>
<li>Restart your webserver</li>
<li>Check the output of <tt>phpinfo()</tt> to make sure Xdebug is properly loaded</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.tequilafish.com/2005/08/22/xdebug-phpize-for-php-on-freebsd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

