<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4138507172045270573</id><updated>2012-01-28T02:25:08.653-05:00</updated><title type='text'>Using Zend Framework</title><subtitle type='html'>Tutorials and Explanations of the Zend Framework for PHP5</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://usingzendframework.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4138507172045270573/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://usingzendframework.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jon T</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4138507172045270573.post-1121487423655498556</id><published>2007-12-08T15:21:00.001-05:00</published><updated>2008-05-08T01:47:20.704-05:00</updated><title type='text'>Setting Up PHPUnit</title><content type='html'>I've put off setting up unit tests for my code far too long.  I am ashamed.  I've set aside this entire month to do all these things that appear like luxuries to non-developers, even though they're really &lt;span style="font-style:italic;"&gt;essential&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;For those of you who haven't been following, this is a Windows installation.  I'm attempting to install the latest and greatest &lt;a href="http://www.phpunit.de/"&gt;PHPUnit3&lt;/a&gt; (3.2.4 at the time of this writing).  It seems that either no one cares about doing this on Windows or only really smart people who find it so simple that they didn't bother to write about it have ever done it.  Because half way through writing this (after publishing it half-done), I searched for "installing phpunit on windows" and this very blog article came up on the 2nd page.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_oi8rW0DCDD4/R1v3mFwz40I/AAAAAAAAAEM/8D5915toM1E/s1600-h/installing-phpunit-search.gif"&gt;&lt;img style="margin:1em;cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_oi8rW0DCDD4/R1v3mFwz40I/AAAAAAAAAEM/8D5915toM1E/s320/installing-phpunit-search.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5141975633327547202" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Nice going Google, but not very helpful.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Quick Summary&lt;/h3&gt;&lt;br /&gt;For the impatient, here's a quick summary of what I had to do.  Afterwards is the detailed story of how I got to this.  I assume you already have PHP installed in C:\php.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;code&gt;C:\php&amp;gt;go-pear.bat&lt;/code&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Merge C:\php\PEAR_ENV.reg&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;C:\php&amp;gt;pear channel-discover pear.phpunit.de&lt;/code&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Change &lt;code&gt;memory_limit&lt;/code&gt; in php.ini to something high like 64M.  (Remember the old setting.)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Save php.ini.  Restart Apache.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;C:\php&amp;gt;pear install --alldeps phpunit/PHPUnit&lt;/code&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Change &lt;code&gt;memory_limit&lt;/code&gt; in php.ini back to what it was before.  (The default is 8M I think.)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Save php.ini.  Restart Apache.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;h3&gt;Detailed Story&lt;/h3&gt;&lt;br /&gt;Now for the detailed story of how I got to the above steps.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://pear.php.net/manual/en/installation.getting.php"&gt;Install PEAR&lt;/a&gt;&lt;br /&gt;I currently have PHP 5.2.3 installed, and I installed PEAR on 8 December 2007 getting the following output accepting the default options.&lt;br /&gt;&lt;div class="code"&gt;C:\php&amp;gt;go-pear.bat&lt;br /&gt;&lt;br /&gt;Are you installing a system-wide PEAR or a local copy?&lt;br /&gt;(system|local) [system] : system&lt;br /&gt;&lt;br /&gt;Below is a suggested file layout for your new PEAR installation.  To&lt;br /&gt;change individual locations, type the number in front of the&lt;br /&gt;directory.  Type 'all' to change all of them or simply press Enter to&lt;br /&gt;accept these locations.&lt;br /&gt;&lt;br /&gt; 1. Installation base ($prefix)        : C:\php&lt;br /&gt; 2. Temporary directory for processing : C:\php\tmp&lt;br /&gt; 3. Temporary directory for downloads  : C:\php\tmp&lt;br /&gt; 4. Binaries directory                 : C:\php&lt;br /&gt; 5. PHP code directory ($php_dir)      : C:\php\pear&lt;br /&gt; 6. Documentation directory            : C:\php\pear\docs&lt;br /&gt; 7. Data directory                     : C:\php\pear\data&lt;br /&gt; 8. Tests directory                    : C:\php\pear\tests&lt;br /&gt; 9. Name of configuration file         : C:\WINDOWS\pear.ini&lt;br /&gt;10. Path to CLI php.exe                : C:\php\.&lt;br /&gt;&lt;br /&gt;1-10, 'all' or Enter to continue:&lt;br /&gt;Beginning install...&lt;br /&gt;Configuration written to C:\WINDOWS\pear.ini...&lt;br /&gt;Initialized registry...&lt;br /&gt;Preparing to install...&lt;br /&gt;installing phar://go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.3.2.tar...&lt;br /&gt;installing phar://go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.2.2.tar...&lt;br /&gt;&lt;br /&gt;installing phar://go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.5.4.tar...&lt;br /&gt;installing phar://go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.0.2.tar...&lt;br /&gt;pear/PEAR can optionally use package "pear/XML_RPC" (version &amp;gt;= 1.4.0)&lt;br /&gt;install ok: channel://pear.php.net/Archive_Tar-1.3.2&lt;br /&gt;install ok: channel://pear.php.net/Console_Getopt-1.2.2&lt;br /&gt;install ok: channel://pear.php.net/Structures_Graph-1.0.2&lt;br /&gt;install ok: channel://pear.php.net/PEAR-1.5.4&lt;br /&gt;PEAR: Optional feature webinstaller available (PEAR's web-based installer)&lt;br /&gt;PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)&lt;br /&gt;PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)&lt;br /&gt;&lt;br /&gt;PEAR: To install optional features use "pear install pear/PEAR#featurename"&lt;br /&gt;&lt;br /&gt;******************************************************************************&lt;br /&gt;WARNING!  The include_path defined in the currently used php.ini does not&lt;br /&gt;contain the PEAR PHP directory you just specified:&lt;br /&gt;&amp;lt;C:\php\pear&amp;gt;&lt;br /&gt;If the specified directory is also not in the include_path used by&lt;br /&gt;your scripts, you will have problems getting any PEAR packages working.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Would you like to alter php.ini &amp;lt;C:\php\php.ini&amp;gt;? [Y/n] : Y&lt;br /&gt;&lt;br /&gt;php.ini &amp;lt;C:\php\php.ini&amp;gt; include_path updated.&lt;br /&gt;&lt;br /&gt;Current include path           : .&lt;br /&gt;Configured directory           : C:\php\pear&lt;br /&gt;Currently used php.ini (guess) : C:\php\php.ini&lt;br /&gt;Press Enter to continue:&lt;br /&gt;&lt;br /&gt;** WARNING! Old version found at C:\php, please remove it or be sure to use the&lt;br /&gt;new c:\php\pear.bat command&lt;br /&gt;&lt;br /&gt;The 'pear' command is now at your service at c:\php\pear.bat&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;* WINDOWS ENVIRONMENT VARIABLES *&lt;br /&gt;For convenience, a REG file is available under C:\php\PEAR_ENV.reg .&lt;br /&gt;This file creates ENV variables for the current user.&lt;br /&gt;&lt;br /&gt;Double-click this file to add it to the current user registry.&lt;br /&gt;&lt;br /&gt;Press any key to continue . . .&lt;br /&gt;&lt;br /&gt;C:\php&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;I then merged the PEAR_ENV.reg file as specified.&lt;br /&gt;&lt;br /&gt;You should make sure that running &lt;code&gt;pear&lt;/code&gt; at the command-line dumps a list of commands.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.phpunit.de/pocket_guide/3.2/en/installation.html"&gt;Install PHPUnit&lt;/a&gt;&lt;br /&gt;&lt;div class="code"&gt;C:\php&amp;gt;pear channel-discover pear.phpunit.de&lt;br /&gt;Adding Channel "pear.phpunit.de" succeeded&lt;br /&gt;Discovery of channel "pear.phpunit.de" succeeded&lt;br /&gt;&lt;br /&gt;C:\php&amp;gt;pear install phpunit/PHPUnit&lt;br /&gt;Did not download optional dependencies: pear/Image_GraphViz, pear/Log, use --alldeps to download automatically&lt;br /&gt;phpunit/PHPUnit can optionally use package "pear/Image_GraphViz" (version &amp;gt;= 1.2.1)&lt;br /&gt;phpunit/PHPUnit can optionally use package "pear/Log"&lt;br /&gt;phpunit/PHPUnit can optionally use PHP extension "pdo_sqlite"&lt;br /&gt;phpunit/PHPUnit can optionally use PHP extension "xdebug" (version &amp;gt;= 2.0.0)&lt;br /&gt;downloading PHPUnit-3.2.4.tgz ...&lt;br /&gt;Starting to download PHPUnit-3.2.4.tgz (198,003 bytes)&lt;br /&gt;.........................................done: 198,003 bytes&lt;br /&gt;&lt;br /&gt;Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 73 bytes) in C:\php\PEAR\PEAR\PackageFile\v2\Validator.php on line 1021&lt;br /&gt;&lt;br /&gt;C:\php&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Now what?&lt;br /&gt;Did it seriously run out of memory?&lt;br /&gt;...I'll finish this post another day (tomorrow?), and hopefully I'll figure it out.&lt;br /&gt;&lt;br /&gt;::day passes::&lt;br /&gt;&lt;br /&gt;...Okay, I'm back.  After checking my php.ini file, I found that the memory limit was indeed 8M.  So I changed &lt;div class="code"&gt;memory_limit = 8M&lt;/div&gt; to &lt;div class="code"&gt;memory_limit = 64M&lt;/div&gt;&lt;br /&gt;Save, and restart Apache (necessary if you're running PHP as a module).&lt;br /&gt;&lt;br /&gt;This time I decided to use the --alldeps option as indicated by my last run.  If PHPUnit can use GraphViz to make pretty output, that would be great.  So here goes another shot.&lt;br /&gt;&lt;div class="code"&gt;C:\php&amp;gt;pear install --alldeps phpunit/PHPUnit&lt;br /&gt;WARNING: "pear/DB" is deprecated in favor of "pear/MDB2"&lt;br /&gt;phpunit/PHPUnit can optionally use PHP extension "pdo_sqlite"&lt;br /&gt;phpunit/PHPUnit can optionally use PHP extension "xdebug" (version &amp;gt;= 2.0.0)&lt;br /&gt;pear/Log can optionally use PHP extension "sqlite"&lt;br /&gt;downloading PHPUnit-3.2.4.tgz ...&lt;br /&gt;Starting to download PHPUnit-3.2.4.tgz (198,003 bytes)&lt;br /&gt;.........................................done: 198,003 bytes&lt;br /&gt;downloading Image_GraphViz-1.2.1.tgz ...&lt;br /&gt;Starting to download Image_GraphViz-1.2.1.tgz (4,872 bytes)&lt;br /&gt;...done: 4,872 bytes&lt;br /&gt;downloading Log-1.9.11.tgz ...&lt;br /&gt;Starting to download Log-1.9.11.tgz (38,479 bytes)&lt;br /&gt;...done: 38,479 bytes&lt;br /&gt;downloading DB-1.7.13.tgz ...&lt;br /&gt;Starting to download DB-1.7.13.tgz (132,246 bytes)&lt;br /&gt;...done: 132,246 bytes&lt;br /&gt;downloading MDB2-2.4.1.tgz ...&lt;br /&gt;Starting to download MDB2-2.4.1.tgz (119,790 bytes)&lt;br /&gt;...done: 119,790 bytes&lt;br /&gt;install ok: channel://pear.phpunit.de/PHPUnit-3.2.4&lt;br /&gt;install ok: channel://pear.php.net/Image_GraphViz-1.2.1&lt;br /&gt;install ok: channel://pear.php.net/Log-1.9.11&lt;br /&gt;install ok: channel://pear.php.net/DB-1.7.13&lt;br /&gt;install ok: channel://pear.php.net/MDB2-2.4.1&lt;br /&gt;MDB2: Optional feature fbsql available (Frontbase SQL driver for MDB2)&lt;br /&gt;MDB2: Optional feature ibase available (Interbase/Firebird driver for MDB2)&lt;br /&gt;MDB2: Optional feature mysql available (MySQL driver for MDB2)&lt;br /&gt;MDB2: Optional feature mysqli available (MySQLi driver for MDB2)&lt;br /&gt;MDB2: Optional feature mssql available (MS SQL Server driver for MDB2)&lt;br /&gt;MDB2: Optional feature oci8 available (Oracle driver for MDB2)&lt;br /&gt;MDB2: Optional feature pgsql available (PostgreSQL driver for MDB2)&lt;br /&gt;MDB2: Optional feature querysim available (Querysim driver for MDB2)&lt;br /&gt;MDB2: Optional feature sqlite available (SQLite2 driver for MDB2)&lt;br /&gt;To install use "pear install pear/MDB2#featurename"&lt;br /&gt;&lt;br /&gt;C:\php&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;It looks like it worked.  :-)&lt;br /&gt;&lt;br /&gt;Run &lt;code&gt;phpunit&lt;/code&gt; at the command-line to test that it worked.  You should get a version and usage message dumped.&lt;br /&gt;&lt;br /&gt;Change the memory limit back to 8M.  Save, restart.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Test the Test Framework&lt;br /&gt;To further test that my installation was actually working, I made a dummy test that always fails.  Like so...&lt;br /&gt;&lt;div class="code"&gt;&amp;lt;?php&lt;br /&gt;require_once 'PHPUnit/Framework.php';&lt;br /&gt; &lt;br /&gt;class DummyTest extends PHPUnit_Framework_TestCase {&lt;br /&gt;&lt;br /&gt;  public function testFail() {&lt;br /&gt;    $this-&gt;fail('Your test successfully failed!');&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;...and put it in my C:\ root directory as DummyTest.php.  This way I can make sure my path is setup correctly to use PHPUnit from anywhere.&lt;br /&gt;&lt;br /&gt;Sure enough, I get some good test-output.&lt;br /&gt;&lt;div class="code"&gt;C:\&amp;gt;phpunit DummyTest&lt;br /&gt;PHPUnit 3.2.4 by Sebastian Bergmann.&lt;br /&gt;&lt;br /&gt;F&lt;br /&gt;&lt;br /&gt;Time: 0 seconds&lt;br /&gt;&lt;br /&gt;There was 1 failure:&lt;br /&gt;&lt;br /&gt;1) testFail(DummyTest)&lt;br /&gt;Your test successfully failed!&lt;br /&gt;C:\DummyTest.php:7&lt;br /&gt;&lt;br /&gt;FAILURES!&lt;br /&gt;Tests: 1, Failures: 1.&lt;br /&gt;&lt;br /&gt;C:\&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;That's it!  I hope this is helpful to &lt;span style="font-style:italic;"&gt;someone&lt;/span&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4138507172045270573-1121487423655498556?l=usingzendframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingzendframework.blogspot.com/feeds/1121487423655498556/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4138507172045270573&amp;postID=1121487423655498556' title='38 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4138507172045270573/posts/default/1121487423655498556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4138507172045270573/posts/default/1121487423655498556'/><link rel='alternate' type='text/html' href='http://usingzendframework.blogspot.com/2007/12/setting-up-phpunit.html' title='Setting Up PHPUnit'/><author><name>Jon T</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_oi8rW0DCDD4/R1v3mFwz40I/AAAAAAAAAEM/8D5915toM1E/s72-c/installing-phpunit-search.gif' height='72' width='72'/><thr:total>38</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4138507172045270573.post-5236882873813306834</id><published>2007-12-08T11:34:00.000-05:00</published><updated>2007-12-08T12:15:01.188-05:00</updated><title type='text'>Updated ZF .htaccess</title><content type='html'>A while back, I talked about how to &lt;a href="http://usingzendframework.blogspot.com/2007/01/setting-up-zend-framework.html"&gt;setup a bootstrap&lt;/a&gt; on Apache to use with ZF.  Since then, I've made a few modifications to my .htaccess file that I think are worth documenting.&lt;br /&gt;&lt;br /&gt;First of all, I ran into a problem where flash files were referencing other binary files (.swf and .flv) relatively.  But with ZF's URL rewriting, this was getting totally messed up, and only certain components of Flash objects were showing up.  The fix I needed was in the .htaccess RewriteRules.  The new rules I have are like so.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;RewriteEngine on&lt;br /&gt;RewriteBase /&lt;br /&gt;&lt;br /&gt;RewriteRule !\.(js|ico|gif|jpg|png|css|flv|swf)$ index.php&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Of course, if I had read the updated &lt;a href="http://framework.zend.com/manual/en/zend.controller.html#zend.controller.quickstart.go"&gt;ZF documentation&lt;/a&gt;, I would have already known that.&lt;br /&gt;&lt;br /&gt;Another "fix" I've used in my .htaccess file has to do with caching.  Back in the day when websites were static, site-wide .css files were great.  Not only did it allow for updating the entire site in one place, but it allowed browsers to cache the CSS so downloading pages that used it was even faster.&lt;br /&gt;&lt;br /&gt;Problem: What if you add a feature to your site which requires new style rules.  Since browsers have cached the .css file, any updates to it won't be seen until either the browser decides to refresh its cache or the user specifically Refreshes.  Having that designer blood in me, I just can't stand the thought that some people will view that new feature without having the styles for it.&lt;br /&gt;&lt;br /&gt;I came up with a bunch of ways to fix this, and they all suck in one way or another.  One method that is particularly appealing to me as a programmer is to ditch browser-level caching by making everything a page style (in a style tag in the head of every page).  This way, when a browser gets updates to a page, it will also get the updates to the CSS, and they will always be in sync.  If you want to keep the ability to change one thing and change the whole site, simply move common CSS rules into a separate file which is included by your PHP.&lt;br /&gt;&lt;br /&gt;The way we ended up doing it though &amp;mdash; since my designer wanted to avoid PHP as much as possible &amp;mdash; was with a .htaccess modification.  The idea was that we wanted to disable browser-level caching of .css files.  So I added the following to our .htaccess file which tells browsers to only cache .css files for 5 minutes.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&amp;lt;IfModule mod_headers.c&amp;gt;&lt;br /&gt;&lt;br /&gt;  # Cache library files for 5 minutes&lt;br /&gt;  &amp;lt;FilesMatch "\.css$"&amp;gt;&lt;br /&gt;    Header set Cache-Control "max-age=300"&lt;br /&gt;  &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/IfModule&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The nice thing about this is Apache simply adds a header to all your .css files without you having to modify anything in your code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4138507172045270573-5236882873813306834?l=usingzendframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingzendframework.blogspot.com/feeds/5236882873813306834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4138507172045270573&amp;postID=5236882873813306834' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4138507172045270573/posts/default/5236882873813306834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4138507172045270573/posts/default/5236882873813306834'/><link rel='alternate' type='text/html' href='http://usingzendframework.blogspot.com/2007/12/updated-zf-htaccess.html' title='Updated ZF .htaccess'/><author><name>Jon T</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4138507172045270573.post-457563697423167325</id><published>2007-12-08T10:44:00.000-05:00</published><updated>2007-12-08T12:40:22.381-05:00</updated><title type='text'>Peculiar Workarounds</title><content type='html'>I just wanted to capture some miscellaneous workarounds that I've had to use while creating a site in PHP on a shared host.&lt;br /&gt;&lt;br /&gt;For now, I've just been using a shared Linux hosting plan.  (BTW, don't ever use &lt;a href="http://www.1and1.com/"&gt;1&amp;amp;1&lt;/a&gt;!  Besides being terribly slow and going down randomly for hours in the middle of the day, their support is just atrocious.  I once had a problem scheduling cron jobs, so I decided to email them for help.  Their reply was of no use.  I ended up figuring it out on my own though, so I sent another email to them to tell them how I solved the problem &amp;mdash; the crontab file needed a newline at the end.  They &lt;span style="font-style:italic;"&gt;completely&lt;/span&gt; didn't get what I was saying and acted as if I was still having a problem.)&lt;br /&gt;&lt;br /&gt;And on this shared host, PHP5 is run as a cgi.  Running &lt;a href="http://us.php.net/manual/en/function.phpinfo.php"&gt;phpinfo()&lt;/a&gt;, I found that in order to modify the php.ini settings, you had to include the php.ini file in &lt;span style="font-style:italic;"&gt;every&lt;/span&gt; directory.  (Be careful.  A php.ini file overrides all settings, and defaults are used for unspecified settings.  It doesn't extend the current settings.)  So I made a script that copies the php.ini file I made into every subdirectory.&lt;br /&gt;&lt;br /&gt;An alternative if you're using a bootstrap file, is to set the ini settings programmatically in the bootstrap using &lt;a href="http://us.php.net/manual/en/function.ini-set.php"&gt;ini-set&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Another peculiar problem I found on this shared host using the Zend Framework had something to do with the rewriting of URLs.  When I had a controller named Posts and tried to go to a URL like /posts/view, it would work perfectly on my server but would give a 404 on the shared host.  I actually already mentioned this at the end of &lt;a href="http://usingzendframework.blogspot.com/2007/01/setting-up-zend-framework.html"&gt;another post&lt;/a&gt;, but I thought it should be pointed out because I just know this is the kind of thing I will forget about and spend hours trying to fix again.&lt;br /&gt;&lt;br /&gt;The workaround I found was to create a dummy directory called posts (or whatever your controller is named) and duplicate the RewriteRules in a .htaccess file in that directory.  In other words, something like this:&lt;br /&gt;&lt;div class="code php"&gt;RewriteEngine on&lt;br /&gt;RewriteBase /&lt;br /&gt;&lt;br /&gt;RewriteRule !\.(js|ico|gif|jpg|png|css|flv|swf)$ index.php&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;I think it had something to do with the fact that I was using Apache 2.0 while the shared host was using 1.x.  On the shared host, it was looking for a directory called posts instead of using the RewriteRules in the .htaccess file in the web root directory.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4138507172045270573-457563697423167325?l=usingzendframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingzendframework.blogspot.com/feeds/457563697423167325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4138507172045270573&amp;postID=457563697423167325' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4138507172045270573/posts/default/457563697423167325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4138507172045270573/posts/default/457563697423167325'/><link rel='alternate' type='text/html' href='http://usingzendframework.blogspot.com/2007/12/peculiar-workarounds.html' title='Peculiar Workarounds'/><author><name>Jon T</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4138507172045270573.post-2827196566785016194</id><published>2007-01-29T21:38:00.000-05:00</published><updated>2007-02-01T20:17:42.460-05:00</updated><title type='text'>Zend Framework Overview</title><content type='html'>&lt;h4&gt;Bootstrapping&lt;/h4&gt;All requests are sent to a single application entry-point.  The bootstrap file loads classes and libraries common to all pages on the site.  It then does things that need to be done for every request like setting up the database with Zend_Db or loading permission rules via Zend_Acl or starting the session with Zend_Session.   It then creates an instance of the Zend_Controller_Front class which is used to dispatch the request to the correct controller and return the response to the client.&lt;br /&gt;&lt;br /&gt;For objects that may need to be accessed by controllers or other classes after dispatching, a registry has been created.  The bootstrap file can create objects with complicated initialization, possibly utilizing config files, and store these objects in the registry with the Zend::register function.  Values can then simply be pulled out of this at will with the Zend::registry function.  The advantage of using this over globals is that it is clear whenever you are accessing a shared variable, which can be especially important with PHP's lack of variable declaration.  (Although, if you stick to an all-object-oriented design, this might not be a problem.)  Additionally, the Zend_Registry class can be subclassed, allowing for exotic data structures, logging of registry use, persistence, etc.&lt;div class="code php"&gt;// Create the view and store it for later use.&lt;br /&gt;$view = new Zend_View();&lt;br /&gt;$view-&gt;setScriptPath('./application/views');&lt;br /&gt;Zend::register('view', $view);&lt;/div&gt;&lt;h4&gt;Controllers and Actions&lt;/h4&gt;Every valid URI must have a corresponding action that is executed when it is requested.  If the router does not find one, an exception is thrown — either an instance of Zend_Exception or one of its subclasses like Zend_Controller_Exception.  The current default router, implemented in the Zend_Controller_Router class, matches URIs against the pattern "/controller/action/param1/value1/param2/value2".  There can be zero or arbitrarily many  parameters.  If the action is omitted, it defaults to the index action, and if the controller is omitted, it defaults to the index controller.  The parameters are stored in an array that can be accessed via the _getParam or _getAllParams methods of the Zend_Controller_Action class, the class which all controllers must subclass.  Trailing slashes are ignored, mapping to identical actions with identical parameters.&lt;br /&gt;&lt;br /&gt;To map a URI to an action method, first create the controller class by postfixing its name with "Controller" and extending Zend_Controller_Action.  In this class, any method named with the postfix "Action" will be mapped to a URI.  For example, to create a handler for the URI "/" — which gets routed to the index action of the index controller — we need a class named IndexController that extends Zend_Controller_Action, with a method named indexAction.  In order for the framework to load this class automatically, put this class definition in a file named IndexController.php your controller directory &amp;mdash; /webroot/application/controllers/ if you're using the &lt;a href="http://usingzendframework.blogspot.com/2007/01/setting-up-zend-framework.html"&gt;standard bootstrap file&lt;/a&gt; I described.&lt;div class="code php"&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;class IndexController extends Zend_Controller_Action&lt;br /&gt;{&lt;br /&gt;&amp;#09;// Handles "/", "/index", "/index/", "/index/index", "/index/index/"&lt;br /&gt;&amp;#09;public function indexAction()&lt;br /&gt;&amp;#09;{&lt;br /&gt;&amp;#09;}&lt;br /&gt;&lt;br /&gt;&amp;#09;// Handles "/index/foo", "/index/foo/"&lt;br /&gt;&amp;#09;public function fooAction()&lt;br /&gt;&amp;#09;{&lt;br /&gt;&amp;#09;}&lt;br /&gt;}&lt;/div&gt;Regardless of how many parameters are expected, action methods are always called with zero parameters.  But parameters specified in the URI can be accessed with _getParam and the like.  For example, if /index/index/param1/value1/ were requested, $this-&gt;_getParam('param1') in the indexAction method would return 'value1'.&lt;br /&gt;&lt;br /&gt;To handle the URI /downloads/list, create a file named DownloadsController.php in the controllers directory.  Make a class named DownloadsController extending Zend_Controller_Action, and in it, create a method named listAction.&lt;div class="code php"&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;class DownloadsController extends Zend_Controller_Action&lt;br /&gt;{&lt;br /&gt;&amp;#09;// Handles "/downloads/list", "/downloads/list/"&lt;br /&gt;&amp;#09;public function listAction()&lt;br /&gt;&amp;#09;{&lt;br /&gt;&amp;#09;}&lt;br /&gt;}&lt;/div&gt;&lt;br /&gt;When you echo or print in an action method, the output is sent in the body of the response to the client.  The Zend_Controller_Response_Abstract class was created to abstract over this and allow for easy switching between output formats, say, from XML to JSON.  The interface though is a little annoying since&lt;div class="code php"&gt;echo coolStuffToOutput($howCool);&lt;/div&gt;becomes&lt;div class="code php"&gt;$this-&gt;getResponse()-&gt;appendBody(coolStuffToOutput($howCool));&lt;/div&gt;which is much clumsier.  One might argue that this method of outputting shouldn't be used often anyway since most output will be part of a template and output using a view.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4138507172045270573-2827196566785016194?l=usingzendframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingzendframework.blogspot.com/feeds/2827196566785016194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4138507172045270573&amp;postID=2827196566785016194' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4138507172045270573/posts/default/2827196566785016194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4138507172045270573/posts/default/2827196566785016194'/><link rel='alternate' type='text/html' href='http://usingzendframework.blogspot.com/2007/01/zend-framework-overview.html' title='Zend Framework Overview'/><author><name>Jon T</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4138507172045270573.post-5450720481349031943</id><published>2007-01-27T16:57:00.000-05:00</published><updated>2007-01-28T22:05:00.265-05:00</updated><title type='text'>Setting Up the Zend Framework</title><content type='html'>Setting up the Zend Framework is easy even on shared hosts since no binaries need to be installed.  But if you don't know the intricacies of Apache and PHP, certain requests can fail to work for seemingly no apparent reason.&lt;br /&gt;&lt;br /&gt;I originally learned from an older version of a tutorial called &lt;a href="http://www.akrabat.com/wp-content/uploads/getting-started-with-the-zend-framework_122.pdf"&gt;Getting Started with the Zend Framework [pdf]&lt;/a&gt; from &lt;a href="http://www.akrabat.com/zend-framework-tutorial/"&gt;Akra's DevNotes&lt;/a&gt;, so I will follow his lead with a few stylistic choices.  You may want to check out that tutorial or a newer version of it if it's out.&lt;br /&gt;&lt;br /&gt;This is just a bare-bones setup.  Nothing fancy.  No databases, forms, etc.  Just "hello world" to get you started.  You'll want to get this working before moving on, of course.&lt;ol&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;Zend Library&lt;/span&gt;&lt;br /&gt;I'm using version 0.7.0.  Unzip ZF and copy the library directory (ZendFramework-0.7.0/library/) into your webroot so that you have /webroot/library/.  This directory should contain Zend.php and a Zend subdirectory.  This is really all you need to start using Zend, but there are a few standard things that still need to be done for a website.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;PHP Config&lt;/span&gt;&lt;br /&gt;You'll want to make sure the following two php.ini settings are set.&lt;br /&gt;&lt;span class="code"&gt;register_globals = Off&lt;br /&gt;magic_quotes_gpc = Off&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you're using PHP as an Apache module, remember to restart Apache for changes to take effect.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;Apache Config&lt;/span&gt;&lt;br /&gt;Right now, anyone can navigate to or request a file in your library directory.  To prevent this, use a .htaccess file in the library directory, /webroot/library/, with the following directive.  You will also want to copy this into your application directory, /webroot/application/, where you store all your application-specific &lt;abbr title="Model-View-Controller"&gt;MVC&lt;/abbr&gt; files.&lt;br /&gt;&lt;span class="code"&gt;deny from all&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;Bootstrapping&lt;/span&gt;&lt;br /&gt;Bootstrapping allows all URL requests to be processed through a single entry-point, called the bootstrap file.  This way, URLs can be mapped to controller actions.  In /webroot/.htaccess, add the following lines which internally redirect all URLs to the index.php file.&lt;br /&gt;&lt;span class="code"&gt;RewriteEngine on&lt;br /&gt;RewriteBase /&lt;br /&gt;RewriteRule .* index.php&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;However, certain files like client scripts, style sheets, and images should be served as normal without involving the framework.  So in your public directory, /webroot/public/, where such files are stored, add the following in another .htaccess file.&lt;br /&gt;&lt;span class="code"&gt;RewriteEngine off&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you're using phpMyAdmin in a subdirectory on a local server, you'll want to do the same for that directory to serve files as usual.&lt;br /&gt;&lt;br /&gt;Now /webroot/index.php is the bootstrap file and the entry-point for all requests, besides in the /webroot/public/ directory.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;Standard Bootstrap File and Dispatching&lt;/span&gt;&lt;br /&gt;The following is a bare-bones bootstrap file that uses standard routing.  Put this in /webroot/index.php.&lt;br /&gt;&lt;div class="code php"&gt;&amp;lt;?php&lt;br /&gt;error_reporting(E_ALL|E_STRICT);&lt;br /&gt;date_default_timezone_set('America/New_York');&lt;br /&gt;&lt;br /&gt;// Load Zend.&lt;br /&gt;set_include_path('.' . PATH_SEPARATOR . './library'&lt;br /&gt;&amp;#09;. PATH_SEPARATOR . './application/models/'&lt;br /&gt;&amp;#09;. PATH_SEPARATOR . get_include_path());&lt;br /&gt;include 'Zend.php';&lt;br /&gt;&lt;br /&gt;// Load classes used on all requests.&lt;br /&gt;Zend::loadClass('Zend_Controller_Front');&lt;br /&gt;&lt;br /&gt;// Setup controller.&lt;br /&gt;$frontController = Zend_Controller_Front::getInstance();&lt;br /&gt;$frontController-&gt;setControllerDirectory('./application/controllers');&lt;br /&gt;&lt;br /&gt;// Turn on display of exceptions.&lt;br /&gt;$frontController-&gt;throwExceptions(true);&lt;br /&gt;&lt;br /&gt;// Dispatch and run.&lt;br /&gt;$frontController-&gt;dispatch();&lt;/div&gt;Leaving out the closing ?&amp;gt; is intentional since including it in pure PHP files can lead to unwanted output and hard-to-detect bugs.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;Index Controller and Standard Routing&lt;/span&gt;&lt;br /&gt;To set up a simple index page, create a new file /webroot/application/controllers/IndexController.php and add the following.&lt;div class="code php"&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;class IndexController extends Zend_Controller_Action&lt;br /&gt;{&lt;br /&gt;&amp;#09;function indexAction()&lt;br /&gt;&amp;#09;{&lt;br /&gt;&amp;#09;&amp;#09;echo '&amp;lt;p&amp;gt;in IndexController::indexAction()&amp;lt;/p&amp;gt;';&lt;br /&gt;&amp;#09;}&lt;br /&gt;&lt;br /&gt;&amp;#09;function fooAction()&lt;br /&gt;&amp;#09;{&lt;br /&gt;&amp;#09;&amp;#09;echo '&amp;lt;p&amp;gt;in IndexController::fooAction()&amp;lt;/p&amp;gt;';&lt;br /&gt;&amp;#09;}&lt;br /&gt;}&lt;/div&gt;&lt;br /&gt;Now, visiting http://hostname/ should display a page with "in IndexController::indexAction()", and visiting http://hostname/index/foo/ should display a page with "in IndexController::fooAction()".  Of course, due to the way the default router works, all the following URLs display the same thing.&lt;br /&gt;http://hostname/&lt;br /&gt;http://hostname/index&lt;br /&gt;http://hostname/index/&lt;br /&gt;http://hostname/index/index&lt;br /&gt;http://hostname/index/index/&lt;br /&gt;The default router looks at a URI and matches against the pattern /controller/action/param1/value1/param2/value2.  http://hostname/ defaults to the index action of the index controller, which will be identical to http://hostname/index/index.  This is also identical to http://hostname/index/index/ because the default router trims leading and trailing slashes.  (Curiously, http://hostname/index returns a 400 Bad Request error on my shared hosting site; I'm not sure why.  I never noticed this before.)&lt;br /&gt;&lt;br /&gt;If you're having the problem of navigating to http://hostname/index/index failing (returning a 404) even when http://hostname/ works &amp;mdash; a problem I ran in to working on a shared host &amp;mdash; you must make a dummy /webroot/index/ directory with a .htaccess file telling Apache to use the rewrite router.  In other words, create the directory /webroot/index/, and copy /webroot/.htaccess into it.  This must be done for each subdirectory (equivalently, each controller) that you wish to have.  So if you want /downloads/ to be a valid URI, you must make a /webroot/downloads/ directory.  If you want /archives/ to be a valid URI, you must make a /webroot/archives/ directory, and so on.  Each with the .htaccess file specifying the RewriteRule.  The cause for this has to do with Apache's configuration.  However, I haven't been able to determine the exact reason since the shared host I'm using does not allow access to the config file.&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4138507172045270573-5450720481349031943?l=usingzendframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingzendframework.blogspot.com/feeds/5450720481349031943/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4138507172045270573&amp;postID=5450720481349031943' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4138507172045270573/posts/default/5450720481349031943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4138507172045270573/posts/default/5450720481349031943'/><link rel='alternate' type='text/html' href='http://usingzendframework.blogspot.com/2007/01/setting-up-zend-framework.html' title='Setting Up the Zend Framework'/><author><name>Jon T</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4138507172045270573.post-1284201791457181527</id><published>2007-01-27T15:50:00.000-05:00</published><updated>2007-01-28T22:15:15.420-05:00</updated><title type='text'>Setting Up a Local Server</title><content type='html'>I've always found it to be helpful to have a local server, duplicating the production server as close as possible, while developing.  This saves you from having to upload changes every two seconds.&lt;br /&gt;&lt;br /&gt;I've set up phpMyAdmin/PHP/MySQL/Apache on Windows a few times.  And I'm just now getting to the point where I don't get stuck somewhere along the line.&lt;br /&gt;&lt;br /&gt;I know what you're thinking &amp;mdash; not another tutorial on installing PHP/MySQL/Apache.  But I bet none of the ones out there were geared towards setting up a server for the Zend Framework.&lt;ol&gt;&lt;li&gt;&lt;a href="http://httpd.apache.org/download.cgi"&gt;Apache&lt;/a&gt;&lt;br /&gt;I'm using version 2.0.58.  Make sure to test that this works alone before moving on.&lt;/li&gt;&lt;li&gt;&lt;a href="http://dev.mysql.com/downloads/"&gt;MySQL&lt;/a&gt;&lt;br /&gt;I'm using version 5.0.21.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.php.net/downloads.php"&gt;PHP&lt;/a&gt;&lt;br /&gt;I'm using version 5.2.0.  Use the zip package, not the installation program.  The installer doesn't include certain extensions.  Unzip it to C:\php\.  You could choose another directory, but I have avoided the Program Files directory since spaces in paths have been known to cause problems with some programs.&lt;br /&gt;&lt;br /&gt;Add PHP to your Apache config file.  In Apache 2 using PHP as a module, it's as follows, assuming you unzipped PHP into C:\php\.&lt;br /&gt;&lt;span class="code"&gt;LoadModule php5_module "C:/php/php5apache2.dll"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you're using the Apache module for PHP, you can set the following in the Apache config file to specify the directory where the php.ini file is.  This is better than having to place it in the Windows directory.&lt;br /&gt;&lt;span class="code"&gt;PHPIniDir "C:/php"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Using the framework, you also want to load the rewrite module so that all requests can be sent to a bootstrap file.  So make sure to uncomment or include this.&lt;br /&gt;&lt;span class="code"&gt;LoadModule rewrite_module modules/mod_rewrite.so&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Tell Apache to look for index.php, and not just index.html, when directories are requested.  The index.html.var is only needed here if you're using content-negotiated documents.  If you don't know what they are, you're probably not using them.&lt;br /&gt;&lt;span class="code"&gt;DirectoryIndex index.html index.php index.html.var&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Set the MIME type for php files.&lt;br /&gt;&lt;span class="code"&gt;AddType application/x-httpd-php .php&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Edit the php.ini file and make sure the extension directory is set to where your PHP extensions are located, usually C:\php\ext\.&lt;br /&gt;&lt;span class="code"&gt;extension_dir = ".\ext"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Uncomment the MySQL extension.&lt;br /&gt;&lt;span class="code"&gt;extension=php_mysql.dll&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Also uncomment the multibyte string extension if you plan on using exotic character sets in your database.  phpMyAdmin will cry if you don't enable this.&lt;br /&gt;&lt;span class="code"&gt;extension=php_mbstring.dll&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For the Zend Framework, uncomment or add the following lines if not present.  This enables the &lt;a href="http://www.php.net/manual/en/ref.pdo.php"&gt;PHP Data Objects&lt;/a&gt; extension which Zend uses for accessing the database &amp;mdash; in this case, MySQL.&lt;br /&gt;&lt;span class="code"&gt;extension=php_pdo.dll&lt;br /&gt;extension=php_pdo_mysql.dll&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;While you're editing php.ini, turn off register_globals and magic_quotes.  Turning off register globals is for safety, and turning off magic quotes reduces complication later when inserting data into the database.  I have seen a &lt;abbr title="Zend Framework"&gt;ZF&lt;/abbr&gt; tutorial that states that turning off magic_quotes is required, but I haven't tested this.&lt;br /&gt;&lt;span class="code"&gt;register_globals = Off&lt;br /&gt;magic_quotes_gpc = Off&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Remember to restart Apache to make configuration changes take effect.  If you're using PHP as an Apache module, php.ini is only loaded once on startup.  So changes to php.ini will not take effect until Apache restarts.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.phpmyadmin.net/home_page/downloads.php"&gt;phpMyAdmin&lt;/a&gt;&lt;br /&gt;I'm using version 2.8.0.3.  phpMyAdmin won't work out of the box.  There's a documentation.html file that explains (under the Quick Install section) creating a config file.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;...More details on all this later.  (I know what you're thinking... &lt;span style="font-style:italic;"&gt;yeah, right&lt;/span&gt;.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4138507172045270573-1284201791457181527?l=usingzendframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingzendframework.blogspot.com/feeds/1284201791457181527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4138507172045270573&amp;postID=1284201791457181527' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4138507172045270573/posts/default/1284201791457181527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4138507172045270573/posts/default/1284201791457181527'/><link rel='alternate' type='text/html' href='http://usingzendframework.blogspot.com/2007/01/setting-up-local-server.html' title='Setting Up a Local Server'/><author><name>Jon T</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4138507172045270573.post-1490983040507181173</id><published>2007-01-27T15:39:00.000-05:00</published><updated>2007-01-27T15:46:15.517-05:00</updated><title type='text'>Scope</title><content type='html'>Here are the things I've been working on:&lt;ul&gt;&lt;li&gt;MySQL DB for persistence&lt;/li&gt;&lt;li&gt;Registration/Login&lt;/li&gt;&lt;li&gt;User-Uploaded Content&lt;/li&gt;&lt;li&gt;Permissions&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Things I'm specifically &lt;span style="font-style:italic;"&gt;not&lt;/span&gt; working on at the moment:&lt;ul&gt;&lt;li&gt;Performance Optimization&lt;/li&gt;&lt;li&gt;Internationalization&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4138507172045270573-1490983040507181173?l=usingzendframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingzendframework.blogspot.com/feeds/1490983040507181173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4138507172045270573&amp;postID=1490983040507181173' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4138507172045270573/posts/default/1490983040507181173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4138507172045270573/posts/default/1490983040507181173'/><link rel='alternate' type='text/html' href='http://usingzendframework.blogspot.com/2007/01/scope.html' title='Scope'/><author><name>Jon T</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4138507172045270573.post-2565806322714828849</id><published>2007-01-27T15:26:00.000-05:00</published><updated>2007-01-27T15:49:02.171-05:00</updated><title type='text'>About</title><content type='html'>I've been using the &lt;a href="http://framework.zend.com/"&gt;Zend Framework&lt;/a&gt; since version 0.2.0.  I had never used a web framework prior to that.  The reason I chose Zend as opposed to other frameworks was its simplicity and intuitiveness.  I admit, this conclusion may have only been drawn because of a well-written tutorial that clicked with me.&lt;br /&gt;&lt;br /&gt;Nevertheless, I have been using the Zend framework to build a website and have been following the core classes as they've developed.  As I ran in to problems, I looked for help on the web and found it lacking.  So I decided to create what I wished to see.&lt;br /&gt;&lt;br /&gt;Let's see how long this will last.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4138507172045270573-2565806322714828849?l=usingzendframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingzendframework.blogspot.com/feeds/2565806322714828849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4138507172045270573&amp;postID=2565806322714828849' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4138507172045270573/posts/default/2565806322714828849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4138507172045270573/posts/default/2565806322714828849'/><link rel='alternate' type='text/html' href='http://usingzendframework.blogspot.com/2007/01/about.html' title='About'/><author><name>Jon T</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
