<?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>VerySimple &#187; PHP</title>
	<atom:link href="http://verysimple.com/category/languages/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://verysimple.com</link>
	<description>Custom Software Development</description>
	<lastBuildDate>Wed, 18 Aug 2010 23:16:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>HungryFEED RSS Plugin for WordPress</title>
		<link>http://verysimple.com/2010/07/22/hungryfeed-rss-plugin-for-wordpress/</link>
		<comments>http://verysimple.com/2010/07/22/hungryfeed-rss-plugin-for-wordpress/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 05:53:35 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://verysimple.com/?p=702</guid>
		<description><![CDATA[I decided to delve into the world of WordPress plugin development this week.  I&#8217;m a contributor to a site for film camera gear and we have a page that lists equipment for sale.  We wanted to pull in an RSS feed from eBay and display it on a page.  There seems to be a WordPress [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to delve into the world of WordPress plugin development this week.  I&#8217;m a contributor to a site for film camera gear and we have a page that lists equipment for sale.  We wanted to pull in an RSS feed from eBay and display it on a page.  There seems to be a WordPress plugin for anything, but I was surprised that I couldn&#8217;t find one that worked the way I liked.  Anyway, two hours later and I had managed to write my own.  Without further ado, here&#8217;s <strong><a href="/products/hungryfeed/">HungryFEED</a></strong>.</p>
<p>I&#8217;m really impressed with the WordPress plugin API and distribution system.  It&#8217;s well organized with great documentation.  I was psyched to see the little &#8220;upgrade available&#8221; button next to my own plugin once I published it to the <a href="http://wordpress.org/extend/plugins/">WordPress plugin directory</a>!  Even though I prefer object-oriented code, I have to admit the procedural style of WordPress code is consistent and easy to follow.</p>
<p>In the process I also had get my hands dirty with <a href="http://simplepie.org/">SimplePie</a> RSS library that WordPress uses.  It does a nice job of parsing all kinds of RSS but I found it a bit difficult to debug feed errors.  Its also a little touchy with eBay feeds and there seems to be some glitches using set_feed_url(), so I would up accessing feed_url directly, which doesn&#8217;t seem right.  But it works so it&#8217;ll have to do for now.</p>
<p>If you give the plugin a try, feel free to leave a comment on directly the HungryFEED page.</p>
]]></content:encoded>
			<wfw:commentRss>http://verysimple.com/2010/07/22/hungryfeed-rss-plugin-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Phreeze Running as a Joomla Component</title>
		<link>http://verysimple.com/2010/07/10/phreeze-running-as-a-joomla-component/</link>
		<comments>http://verysimple.com/2010/07/10/phreeze-running-as-a-joomla-component/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 05:37:39 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Digital Life]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://verysimple.com/?p=579</guid>
		<description><![CDATA[Our company has decided on Joomla to manage our primary website, however we&#8217;ve been writing code using our own Phreeze framework for several years and have a lot of time invested in these applications.  We&#8217;re now trying to integrate all of our web properties and provide single sign-on, which is a challenging task.  It occurred [...]]]></description>
			<content:encoded><![CDATA[<p>Our company has decided on <a href="http://www.joomla.org/" target="_blank">Joomla</a> to manage our primary website, however we&#8217;ve been writing code using our own <a href="http://www.phreeze.com" target="_blank">Phreeze</a> framework for several years and have a lot of time invested in these applications.  We&#8217;re now trying to integrate all of our web properties and provide single sign-on, which is a challenging task.  It occurred to me that we might be able to run our Phreeze applications as a plugin within the Joomla framework to avoid having to re-write a lot of code.</p>
<p><span id="more-579"></span><a href="http://verysimple.com/wp-content/uploads/2010/07/poc.png" rel="shadowbox[post-579];player=img;" title="Proof of Concept"><img class="alignright size-medium wp-image-580" title="Proof of Concept" src="http://verysimple.com/wp-content/uploads/2010/07/poc-300x242.png" alt="" width="300" height="242" /></a>The solution so far is to write a custom authentication plugin plus a component for Joomla.  The plugin handles sign-on and the component allows us to render basically anything within the content area of the Joomla site.  I was able to get proof-of-concept running today and not only does the Phreeze code render correctly inside the Joomla system, it wasn&#8217;t even necessary to merge the Phreeze code, it runs just fine with the source code in a separate folder from Joomla.  The component just has to do a little magic and configure some paths to make Phreeze happy.</p>
<p>This seems to be one of those rare moments where strict coding practices actually pays off.  I designed Phreeze to be an extremely modular MVC / ORM with the idea that we might one day use another rendering engine, or switch data engines.  We&#8217;re even in the process of swapping out direct database connection with REST services with no change to the views, which will be exciting.  Dependency injection is used for all the various parts so you can swap anything.  But I hadn&#8217;t really considered running the entire framework within another system.  So I was somewhat surprised when the code just ran with almost no configuration.</p>
<p>The biggest problem is with relative URLs.  Joomla I must say is pretty great about passing control to a component and then staying out of the way, even if you throw lots of weird querystring parameters on the end of the URL.  However, the relative paths to scripts, styles, images, etc are proving to be problematic.</p>
<p>I haven&#8217;t decided on the best approach yet but I&#8217;m considering simply writing new Views for Joomla.  This allows us to re-use all of our Model and Controller code.  I&#8217;d prefer to just use everything exactly as-is in each application but in some ways it might make more sense for the apps to render themselves differently when inside the Joomla system vs when running stand-alone.</p>
<p>Phreeze has a URL writer class which does help to solve the relative URL problem, however we didn&#8217;t use it consistently in all the views and so there is some cleanup to do.  Also this class isn&#8217;t accessible from within static JavaScript code, so that might get messy with some of the more advanced pages that make a lot of Ajax calls.</p>
<p>This is possibly my nerdiest post ever but it&#8217;s exciting to spend so much effort at writing adaptable code and then finally the day comes where you get to see it work in a totally unexpected way.</p>
]]></content:encoded>
			<wfw:commentRss>http://verysimple.com/2010/07/10/phreeze-running-as-a-joomla-component/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install WordPress 3 with Multiple TLDs</title>
		<link>http://verysimple.com/2010/07/09/install-wordpress-3-with-multiple-tlds/</link>
		<comments>http://verysimple.com/2010/07/09/install-wordpress-3-with-multiple-tlds/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 05:27:12 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://verysimple.com/?p=560</guid>
		<description><![CDATA[WordPress 3 now includes the features that were previously available as WordPress MU.  &#8220;MU&#8221; stands for Multi-User (or Multi-Site) and this lets you to run multiple blogs all from a single WordPress installation.  This walk-through will help you configure WordPress to manage multiple sites, each with their own top-level domain (TLD). As you go through [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress 3 now includes the features that were previously available as WordPress MU.  &#8220;MU&#8221; stands for Multi-User (or Multi-Site) and this lets you to run multiple blogs all from a single WordPress installation.  This walk-through will help you configure WordPress to manage multiple sites, each with their own top-level domain (TLD).</p>
<p>As you go through this walk-through, it helps to understand that WordPress MU was originally designed to create a branded, automated community of blogs using <strong>sub-domains</strong> such as user1.wordpress.com, user2.wordpress.com, etc.  You can sign up on wordpress.com right now and get your own instant blog, hosted on their servers.  You become a part of the wordpress.com community.  WordPress MU was designed to allow you to create your own communities under your own domain name branding.</p>
<p>This walk-through addresses a slightly different type of user which is perhaps a server admin or simply a person who runs several blogs.  There is no &#8220;community&#8221; and you don&#8217;t allow anonymous users to stop by and create a blog.  You might currently have WordPress installations on multiple servers with totally unrelated domains.  Keeping the code and plugins updated for multiple blogs gets to be a hassle, so the idea of a single, centralized WordPress install is appealing for maintenance reasons.  Thanks to WordPress&#8217;s flexible architecture you can do this, but it&#8217;s not part of the original design.</p>
<p>The reason I write all of this is to hopefully explain why TLDs are outside the scope of  WordPress&#8217;s original design.  You can still set it up without understanding any of this, however it will make things easier if you know how the pieces fit together.</p>
<p><span id="more-560"></span></p>
<h2>Requirements</h2>
<p>To keep this simple I&#8217;m only going to write about the multi-site configuration.  I&#8217;m assuming you know how to install WordPress, edit config files on your server, create a MySQL database on your host and map sub-domains.  These things may be done differently depending on your host so you will need to do the research for your own host server.  If you run your own server you may have to know how to configure it for multiple domains as well.</p>
<h2>DNS Configuration</h2>
<p>Again, I&#8217;m not going to get into DNS configuration.  However, I will say that a simple setup is to simply point all of your domains to the same IP address and let WordPress do the rest.  You can also assign one domain an IP and then park each additional domain onto this one, which may save hosting fees.  WordPress relies on the hostname, so it doesn&#8217;t matter how you&#8217;ve configured Apache or IP addresses, so long as the domain maps to the physical location of your WordPress install.</p>
<p><em>As a handy tip &#8211; you can edit your local hosts  file to point a domain to the IP of your WordPress installation and WordPress will install easily this  way.  This is a great way to experiment and migrate over an existing site without taking the domain name offline.  If you don&#8217;t understand what this means, then don&#8217;t worry about  it!</em></p>
<h2>1. Install WordPress</h2>
<p>Install using all defaults is fine.  You should install this onto the domain that you plan to use as your &#8220;master&#8221; domain.  My recommendation is to install it at the top level of your domain, for example &#8220;domain.com&#8221; (without the &#8220;www&#8221; prefix).  If you plan to use sub-domains for different sites then this will keep things simple.  You can always add &#8220;www&#8221; during site configuration, but you can&#8217;t remove it from your sub-domain sites if it was installed that way.  For example your sites will look like this: site1.www.domain.com  instead of simply site1.domain.com.</p>
<p>Verify that WordPress is running but don&#8217;t bother putting any content in at this point.  In the next few steps we&#8217;re going to enable new menu items one after the next that are necessary to use the multi-site feature.</p>
<h2>2.Enable the WordPress Multi-Site Feature</h2>
<p><a href="http://verysimple.com/wp-content/uploads/2010/07/ss1.png" rel="shadowbox[post-560];player=img;" title="ss1"><img class="alignright size-full wp-image-561" title="ss1" src="http://verysimple.com/wp-content/uploads/2010/07/ss1.png" alt="" width="160" height="139" /></a>Assuming WordPress is running, edit <strong>wp-config.php</strong> and add the following line:</p>
<p>define(&#8216;WP_ALLOW_MULTISITE&#8217;, true);</p>
<p>After you add this line and save the file, return to the Worpress Admin page and look for a new menu item <strong>Tools-&gt;Network</strong>.  Navigate to this new menu and you&#8217;ll be prompted to &#8220;Create a Network&#8221; in order to enable the multi-site feature.</p>
<p>You have some choices as to whether you want to use sub-domains or sub-folders for your network.  Leave all the defaults and choose sub-domains.  We&#8217;re going to be using separate TLDs anyway so choosing sub-domains seems to make more sense to me.  If you choose folders, you&#8217;ll be on your own from this point forward.</p>
<p><a href="http://verysimple.com/wp-content/uploads/2010/07/ss2.png" rel="shadowbox[post-560];player=img;" title="ss2"><img class="alignright size-full wp-image-562" title="ss2" src="http://verysimple.com/wp-content/uploads/2010/07/ss2.png" alt="" width="158" height="104" /></a>Once you enable the network, you will be given text that you must copy and paste into an <strong>.htaccess</strong> file and some additional variables to be pasted into <strong>wp-config.php</strong>.  Do this as directed on the Network page.</p>
<p>After you edit these files and re-login you should see another new menu &#8220;<strong>Super Admin</strong>&#8221; which is above the dashboard menu.  Your site is now ready for multiple sites.</p>
<h2>3. Install Plugin WordPress MU Domain Mapping</h2>
<p>At this point your server is already setup to handle multiple sites, but we need to install a plugin in order to support TLDs.  The plugin to use is called &#8220;<a href="http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/">wordpress-mu-domain-mapping</a>&#8220;  This plugin also includes a special file known as a &#8220;drop-in&#8221; which must be manually copied and hooks into the lower levels of the WordPress API.</p>
<p>You can install this plugin by manually uploading it, or through &#8220;Plugins-&gt;Add New.&#8221;  Just make sure<br />
you install version .052 or higher.   After you have installed it, go ahead and activate the plugin.  You&#8217;ll notice that plugins now have an option to &#8220;<strong>Network Activate</strong>&#8221; which activates a plugin for all sites.</p>
<p><a href="http://verysimple.com/wp-content/uploads/2010/07/ss3.png" rel="shadowbox[post-560];player=img;" title="ss3"><img class="alignright size-full wp-image-563" title="ss3" src="http://verysimple.com/wp-content/uploads/2010/07/ss3.png" alt="" width="157" height="221" /></a>Once the plugin is installed, you need to manually install the Sunrise &#8220;drop-in&#8221;  which is included with the plugin source files.  You may either copy <strong>sunrise.php</strong> from <strong>/</strong><strong>wp-content/</strong><strong>plugins/wordpress-mu-domain-mapping/</strong> to <strong>/wp-content/</strong> or if you prefer  you can create a symbolic link (for example <em>ln -s plugins/wordpress-mu-domain-mapping/sunrise.php</em>.  I prefer the link myself).</p>
<p>Once you&#8217;ve copied or linked the file, you have to edit <strong>wp-config.php</strong> one last time and add the following line which will tell WordPress to activate the drop-in:</p>
<p>define(  &#8216;SUNRISE&#8217;, &#8216;on&#8217; );</p>
<p>Once you re-load the console you&#8217;ll once again have some new menu items.  This time they appear under the Super Admin menu and they are <strong>Domain Mapping</strong> and <strong>Domains</strong>.  The Domain Mapping has some settings that don&#8217;t actually need to be changed.  The Domains page is where we&#8217;ll map TLDs to a site (in the next step).</p>
<h2>4. Create a Second Site</h2>
<p>At this point your server is fully ready to support TLD sites, you just need to know how to add them.  The basic concept is that you create a site first using WordPress&#8217;s normal functionality.  Then you using the domain mapping plugin to map the TLD to the new site based on it&#8217;s Id.  Because WordPress doesn&#8217;t yet natively support TLDs, you have to do a little fudging with the forms.</p>
<p>First, under <strong>Super Admin</strong> go to the <strong>Sites</strong> page.  You&#8217;ll be confused because you have to choose a sub-domain for your site, even though we&#8217;re going to use a TLD.  That&#8217;s ok, just enter whatever you want as the sub-domain and add the site.</p>
<p>Now that you&#8217;ve added the site, you can click &#8220;Edit&#8221; under the new site and this will bring up a long page with lots of settings.  Don&#8217;t worry about changing everything right now but you do want to change these two fields: <strong>Domain</strong> and <strong>Fileupload URL</strong>.  These need to be changed to your new TLD:</p>
<p><a href="http://verysimple.com/wp-content/uploads/2010/07/ss5.png" rel="shadowbox[post-560];player=img;" title="ss5"><img class="alignnone size-thumbnail wp-image-565" title="ss5" src="http://verysimple.com/wp-content/uploads/2010/07/ss5-150x72.png" alt="" width="150" height="72" /></a> <a href="http://verysimple.com/wp-content/uploads/2010/07/ss6.png" rel="shadowbox[post-560];player=img;" title="ss6"><img class="alignnone size-thumbnail wp-image-566" title="ss6" src="http://verysimple.com/wp-content/uploads/2010/07/ss6-150x150.png" alt="" width="72" height="72" /></a> <a href="http://verysimple.com/wp-content/uploads/2010/07/ss7.png" rel="shadowbox[post-560];player=img;" title="ss7"><img class="alignnone size-medium wp-image-567" title="ss7" src="http://verysimple.com/wp-content/uploads/2010/07/ss7-300x38.png" alt="" width="240" height="30" /></a></p>
<p>At some point once WordPress natively supports TLDs you would probably be done at this point.  In fact you will be able to visit your new site if your domain is already configured, but you won&#8217;t be able to log into the admin panel for the site.  So we need to map the domain over to the new site.</p>
<p><em>Before you leave the Sites page, make a note of the ID of your new site.  (In the screenshot above, my site &#8220;whatever&#8221; has the ID of &#8220;8&#8243;).  If it&#8217;s a new install, then your ID will probably be &#8220;2&#8243;.</em></p>
<p><a href="http://verysimple.com/wp-content/uploads/2010/07/ss8.png" rel="shadowbox[post-560];player=img;" title="ss8"><img class="alignright size-medium wp-image-568" title="ss8" src="http://verysimple.com/wp-content/uploads/2010/07/ss8-300x141.png" alt="" width="180" height="85" /></a>Head to the <strong>Super Admin -&gt; Domains</strong> page and there is a form at the bottom to add a new Domain.  Leave the Primary checkbox checked.  Enter your site ID from above and the domain.  Click Save to add the mapping.</p>
<p>At this point you&#8217;re done and you should be able visit your site using your TLD as well as login to the admin panel.  I hope this tutorial worked for you and helped you to understand how WordPress MU feature works as well as some of it&#8217;s current shortcomings.</p>
<p>Please leave a comment if you have any suggestions to make this walk-through easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://verysimple.com/2010/07/09/install-wordpress-3-with-multiple-tlds/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Installing LAMP stack on OSX 10.6 Snow Leopard</title>
		<link>http://verysimple.com/2009/09/18/installing-lamp-stack-on-osx-10-6-snow-leopard/</link>
		<comments>http://verysimple.com/2009/09/18/installing-lamp-stack-on-osx-10-6-snow-leopard/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 21:55:19 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=414</guid>
		<description><![CDATA[I&#8217;m setting up a new machine and found a great tutorial written by Josh Lockhart on getting a PHP web development environment up and running on Snow Leopard.  This goes through almost everything to be up and running for a typical LAMP stack with unit testing using all of the default services. Josh&#8217;s instructions include [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m setting up a new machine and found a great tutorial written by Josh Lockhart on <a href="http://www.newmediacampaigns.com/page/install-pear-phpunit-xdebug-on-macosx-snow-leopard" target="_blank">getting a PHP web development environment up and running on Snow Leopard</a>.  This goes through almost everything to be up and running for a typical LAMP stack with unit testing using all of the default services.</p>
<p>Josh&#8217;s instructions include everything that I need except mcrypt.  Luckily Michael Gracie has provided a walk-through for <a href="http://michaelgracie.com/2009/09/23/plugging-mcrypt-into-php-on-mac-os-x-snow-leopard-10.6.1/" target="_blank">installing mcrypt on Snow Leopard</a> which involves re-compiling some things, but isn&#8217;t as tough as it first appears.</p>
<p>After getting PHP and mcrypt going, the last step for me is setting up MySQL which has some caveats on OSX.  The main problem is that the MySQL installer places the mysql.sock file in a non-standard place and so you have to either <a href="http://www.verysimple.com/blog/2009/01/07/php-on-os-cant-connect-to-local-mysql-server-through-socket-varmysqlmysqlsock/">create a link or alter your php.ini file</a> before PHP will be able to talk to MySQL.  (If you get <em>&#8220;Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’</em>&#8221; or  “<em>No such file or directory</em>” when calling mysql_connect, then this is the problem)</p>
<p><span id="more-414"></span></p>
<p>After completing the steps on Josh&#8217;s &amp; Michael&#8217;s pages and running the MySQL installation package, here are the additional steps that I like to take to get my local environment configured:</p>
<p><strong>Edit /private/etc/php.ini</strong></p>
<p>display_errors = On<br />
mysql.default_socket = /tmp/mysql.sock<br />
pdo_mysql.default_socket=/tmp/mysql.sock<br />
date.timezone = &#8216;America/Chicago&#8217;</p>
<p><strong>Edit /private/etc/apache2/httpd.conf</strong></p>
<p>DocumentRoot &#8220;/Users/jason/Sites&#8221;</p>
<p><strong>Edit /private/etc/apache2/users/jason.conf</strong></p>
<p>Append <em>FollowSymLinks</em> to the Options</p>
<p>I also like to change the permissions on php.ini and httpd.conf to allow my user account edit permissions and create an alias to those two files somewhere easy to get to.</p>
<p>Installing <a href="http://www.mamp.info" target="_blank">MAMP</a> is probably easier, but for some reason I prefer using all of the services that are pre-bundled with OSX.  Also Snow Leopard includes PHP 5.3 which led me to find a couple of deprecated functions in some of our libraries.</p>
]]></content:encoded>
			<wfw:commentRss>http://verysimple.com/2009/09/18/installing-lamp-stack-on-osx-10-6-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Flex Remoting and WebORB Mysterious Error Messages</title>
		<link>http://verysimple.com/2009/07/01/flex-remoting-and-weborb-mysterious-error-messages/</link>
		<comments>http://verysimple.com/2009/07/01/flex-remoting-and-weborb-mysterious-error-messages/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 20:37:05 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=390</guid>
		<description><![CDATA[If you work with Flex remoting and WebORB, you are probably familiar with the following errors: NetConnection.Call.Failed: HTTP: Status 500 Channel Disconnected You may have tried directing your browser to weborb.php only to get this message: &#8220;WebORB v3.5.0 Fatal error: Call to a member function getServiceURI()&#8221; The getServiceURI message is actually a red herring error [...]]]></description>
			<content:encoded><![CDATA[<p>If you work with Flex remoting and WebORB, you are probably familiar with the following errors:</p>
<ul>
<li>NetConnection.Call.Failed: HTTP: Status 500</li>
<li>Channel Disconnected</li>
</ul>
<p>You may have tried directing your browser to weborb.php only to get this message: &#8220;WebORB v3.5.0 <strong>Fatal error</strong>:  Call to a member function getServiceURI()&#8221;</p>
<p>The getServiceURI message is actually a red herring error message.  This simply occurs because weborb.php is expecting the raw headers to contain Flash remoting AMF message data.  Your browser is just making a normal HTTP GET and doesn&#8217;t know anything about AMF.   So weborb.php winds up with a null object on which it tries to call getServiceURI().  I wouldn&#8217;t be surprised to see a future release of WebORB that catches this error, even though it isn&#8217;t the purpose of this particular file to run inside a browser.</p>
<p><span id="more-390"></span></p>
<p>So, you are probably frustrated because you were trying to figure out what is wrong with your install and why you are getting the connection and/or channel errors.  These errors are almost always the result of a PHP compile-time error.  PHP5 itself is rather inconsistent in the way it handles different types of errors.  You may have noticed that it&#8217;s impossible to catch a syntax error or a bad path in a require_once() statement, for example.  If an include file is missing, PHP craps out before you have a chance to do any error handling.  You can only catch and handle run-time errors within your PHP code.  You may be tempted to think that WebORB should be able to catch these errors and return a more useful message to Flex, however the PHP engine stops executing before it even gives your code or WebORB a chance to handle anything.  It&#8217;s kinda the equivelant of having a syntax error in Java or C code that causes your app to not compile.  It doesn&#8217;t matter what type of error trapping code you write &#8211; if you code doesnt&#8217; even compile, it doesn&#8217;t even get the chance to run.</p>
<p>When any part of either your service or WebORB encounters a compile-time error, it instantly dies and, depending on your server config, will write out the error details to STDOUT (which shows in a browser) but what it does not do is return a proper AMF message to the client.  If you were to look at the output of the PHP page, most likely you would instantly see cause of the error.  However Flex/Flash seemingly ignores the output of the page and it only processes the headers returned by the server (ie 500 error).  So PHP is outputing the details of the error but Flex blocks you from reading it.</p>
<p><em>UPDATE: I now use <a href="http://www.themidnightcoders.com" target="_blank">App Puncher</a> to view error messages now.  A network proxy or packet inspector would probably work as well.  My original info below is still here in case you want to trace down errors by hand.</em></p>
<p>To figure these errors out, I try to start debugging with a simple function that doesn&#8217;t do anything.  Slowly, step-by-step I start re-enabling code until I locate the source of the channel disconnect by process of elimination.  Other times I write a debug page in PHP and call the function in question directly.  (This isn&#8217;t always easy if Flex is passing in complex structures, however, it can be worth the effort sometimes).</p>
<p>I&#8217;ve noticed these things to be sure-fire causes:</p>
<ul>
<li>require_once statement with file missing (or PHP include path not set right).  Note that if you are dynamically calculating the abolute path of the current working directory that it will be different when you are running via the &#8220;Management Console&#8221; than if you call your service directly from Flex.  This is a dead giveaway if it runs in one, but not the other.</li>
<li>passing in an argument to a method that does not match the declared PHP type.  You can detect this by simply removing your type declaration in your methods and see if the data comes through.  This could indicate a mapping problem or an unsupported type.</li>
<li>syntax error that causes PHP compile-time error.  This can be any type of silly syntax error.  These are usually easy to see if you create a server-side page that calls your service method.</li>
<li>If the WebORB examples work, but not your own services, it&#8217;s pretty much a giveaway that PHP is crashing somewhere inside your own service code and not the WebORB installation.</li>
<li>If you can&#8217;t even get the WebORB examples to work, then there is a good chance that editing PHP.ini will be required.  If that&#8217;s the case, hitting weborb.php with your browser can sometimes show you what&#8217;s wrong &#8211; just realize that any errors mentioning either getServiceURI() and FlashorbBinaryReader are due to the missing AMF headers that your browser didn&#8217;t send and are not the problem.</li>
</ul>
<p>If you have a better way of debugging, please post a reply.  This can be an extremely frustrating error to chase down and I would welcome any suggestions.</p>
]]></content:encoded>
			<wfw:commentRss>http://verysimple.com/2009/07/01/flex-remoting-and-weborb-mysterious-error-messages/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CLI has stopped working</title>
		<link>http://verysimple.com/2008/07/03/cli-has-stopped-working/</link>
		<comments>http://verysimple.com/2008/07/03/cli-has-stopped-working/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 06:11:08 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=113</guid>
		<description><![CDATA[&#8220;CLI has stopped working&#8221; is an error that you may encounter when running command-line PHP scripts in Windows.  This has been reported frequently by CakePHP users when their &#8220;bake&#8221; scripts crash.  My particular experience with this issue occurred while running PHPUnit tests from the command line. The top search result as well as others indicates [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;<span class="searchTerm">CLI</span> <span class="searchTerm">has</span> <span class="searchTerm">stopped</span> <span class="searchTerm">working&#8221; is an error that you may encounter when running command-line PHP scripts in Windows.  This has been reported frequently by CakePHP users when their &#8220;bake&#8221; scripts crash.  My particular experience with this issue occurred while running PHPUnit tests from the command line.<br />
</span></p>
<p>The <a href="http://web2.0entrepreneur.com/31/cli-has-stopped-working-on-windows-vista.html" target="_blank">top search result</a> as well as others indicates that this is a problem with php_mysqli.dll however none of the suggestions on this page helped me.  An <a href="http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_23147276.html" target="_blank">experts exchange post</a> indicates that the problem is with libmysql.dll, however I didn&#8217;t know where to download the replacement for libmysql.dll.  It turns out that I already had it and the following solves the problem on My Vista and Windows 2003 boxes:</p>
<p>Copy From: <strong>C:\Program Files\MySQL Server 5.0\bin\libmySQL.dll</strong></p>
<p>Paste To: <strong>C:\Program Files\PHP\</strong> (overwrite the original)</p>
<p><em>This assumes you installed MySQL and PHP to their default locations.  If not, then use the correct paths for your particular setup.</em></p>
<p>Prior to this fix, my unit tests were causing the &#8220;CLI has stopped working&#8221; error at least 50% of the time.  Since replacing the dll file I haven&#8217;t seen the error.</p>
]]></content:encoded>
			<wfw:commentRss>http://verysimple.com/2008/07/03/cli-has-stopped-working/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>PHP on Windows 2003 IIS 6 Displays 404 Page Not Found</title>
		<link>http://verysimple.com/2008/01/05/php-on-windows-2003-iis-6-displays-404-page-not-found/</link>
		<comments>http://verysimple.com/2008/01/05/php-on-windows-2003-iis-6-displays-404-page-not-found/#comments</comments>
		<pubDate>Sun, 06 Jan 2008 04:12:59 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[IIS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.verysimple.com/blog/2008/01/05/php-on-windows-2003-iis-6-displays-404-page-not-found/</guid>
		<description><![CDATA[After Installing PHP 5 using the Windows installer on Windows 2003 you may find that IIS displays a &#8220;Page Not Found&#8221; 404 error for every .php page. This is a perplexing error because is it not actually a real 404 error. The file is really there, but IIS is unable to process it based on [...]]]></description>
			<content:encoded><![CDATA[<p>After Installing PHP 5 using the Windows installer on Windows 2003 you may find that IIS displays a &#8220;Page Not Found&#8221; 404 error for every .php page. This is a perplexing error because is it not actually a real 404 error. The file is really there, but IIS is unable to process it based on how the installer configures the extension mapping. Instead of providing any useful information or even a 500 error; however, IIS throws out a 404.</p>
<p><strong>Steps to Fix the Problem:</strong></p>
<p><em>Before you troubleshoot further, you may want to read #5 about how the Application Pool effects PHP configuration changes.</em></p>
<p>1. Replace the old DOS format path to the PHP Executable with a full path w/ quotes<br />
2. Move php.ini to C:\Windows<br />
3. Edit php.ini to set cgi.force_redirect = 0  (only necessary for CGI mode)<br />
4. Make sure php-cgi.exe and/or phpisapi.dll are included in Web Service Extensions<br />
5. Recycle the Application Pool</p>
<p><strong>1. Replace the old DOS Path Format</strong></p>
<p><a title="Edit Map" href="http://verysimple.com/wp-content/uploads/2008/01/edit_map.png" rel="shadowbox[post-104];player=img;"><img src="http://verysimple.com/wp-content/uploads/2008/01/edit_map-150x150.png" alt="Edit Map" /></a></p>
<p>The default path to PHP is C:\Program Files\PHP. When creating the IIS extention mapping, the PHP Installer uses the old DOS format path to the PHP ISAPI or CGI executable such as &#8220;C:\PROGRA~1\PHP\PHP5IS~1.DLL&#8221;. IIS does not seem to like this format.</p>
<p>One simple solution for this is to simply reinstall PHP to C:\PHP, or another location that doesn&#8217;t use long filenames.  This will generally save you a lot of grief as PHP and its installer do not seem to handle windows long file names consistently.</p>
<p>If you prefer to keep things in Program files, go to the IIS Extension Mapping screen and locate the value for &#8220;.php&#8221; (See screenshot above). Click the browse button, select the executable and put quotes around it the entire path. So the value for this field should look like this <em>&#8220;C:\Program Files\PHP\php5isapi.dll&#8221;</em> (<strong>WITH</strong> the quotes around it). If you have installed PHP in CGI mode instead, the file name would be php-cgi.exe instead of php5isapi.dll</p>
<p>While you&#8217;re at it you may want to check the box for &#8220;Verify that file exists&#8221; as well. This allows IIS to handle actual missing pages (ie broken links) and return a 404. Otherwise IIS will just pass the request to PHP without verifying the .php file really exists and PHP throws a CGI error when the file isn&#8217;t found. People seem to have inconsistent results with this setting.</p>
<p>If you recycle the app pool at this point (see step #5) you *may* solve the 404 error depending on what extensions you installed or whether you had re-run the installer and changed stuff. However, you may still have issues changing php.ini settings in which case keep reading.</p>
<p><strong>2. Copy php.ini to C:\Windows</strong></p>
<p>The PHP installer creates a php.ini file for you based on your selections in the setup process. However the installer saves the file in C:\Program Files\PHP. The problem is that PHP is looking in C:\Windows for the .ini file. So, you need to move the file php.ini to C:\Windows. This may be confusing because PHP seems to run fine. But if you look closely at the phpinfo() output, you may find that php.ini file is not being loaded and all default settings are being used.</p>
<p>One of the critical things when configuring PHP is to actually edit the .ini file that is being used by PHP. The installer creates a worthless file in a location that PHP won&#8217;t read and so you may waste a lot of time editing this file. PHP pretty much universally will check the Windows folder for php.ini on all varieties of Windows, so my advice is to use that location and delete any other php.ini files that are hanging around..</p>
<p><strong>3. Set cgi.force_redirect = 0 (Only necessary for CGI mode)</strong></p>
<p>Various people report that you need to edit php.ini and set:</p>
<pre>cgi.force_redirect = 0</pre>
<p>I haven&#8217;t noticed this setting having any effect on my installations, but many people claim it is necessary when you are running PHP in CGI mode.  This setting will have no effect if you are running in ISAPI mode.</p>
<p><strong>4. Make sure php-cgi.exe and/or phpisapi.dll are enabled in Web Service Extensions</strong></p>
<p>In IIS Manager, click on &#8220;Web Service Extensions&#8221;  This includes a list of all dll and exe files that IIS is allowed to execute.  The extension mapping that is specified for .php files must also be added here.  I prefer to just add both php-cgi.exe as well as php5isapi.dll here and enable them both so that if I don&#8217;t need to worry about it again.</p>
<p>If the handler is already in the list, make sure that it is &#8220;enabled&#8221; as well.  The enabled services have a green overlay on the service icon.</p>
<p>Lastly, confirm that the file path is exactly the same here as it is in your .php extension mapping configuration.  That includes the dos path formatting.  If you use junctions, you need to be using the same path in both places.  IIS seems to check the path rather than the executable.  It will not recognize if you use a slightly different path, even if they both point to the same executable.</p>
<p><strong>5. Recycle the Application Pool</strong></p>
<p>In order for any PHP configuration changes to take effect in Windows 2003, you need to recycle the Application Pool. If you have made changes to php.ini and they don&#8217;t seem to take effect, this is likely the reason. Among other things, the pool caches PHP settings and you need to clear it before new configuration settings will take effect. You&#8217;ll read people telling you to restart IIS (which doesn&#8217;t recycle the app pool) or even reboot your machine (which is overkill). You don&#8217;t need to do either of those. Just right-click on the DefaultAppPool in the IIS management interface and &#8220;Recycle&#8221; is one of the options.</p>
<p><a title="Recycle Pool" href="http://verysimple.com/wp-content/uploads/2008/01/recycle_pool.png" rel="shadowbox[post-104];player=img;"><img src="http://verysimple.com/wp-content/uploads/2008/01/recycle_pool-150x150.png" alt="Recycle Pool" /></a></p>
<p>If I&#8217;m having trouble with the ini file, I like to have a typical phpinfo.php file on the server while I make some arbitrary change to the php.ini file (like the session timeout or the max upload size). I refresh phpinfo.php and verify that my changes are taking effect. You can also check the Windows Event logs under &#8220;System&#8221; which will sometimes report errors in the php.ini file.</p>
<p><strong>Notes regarding re-running the PHP installer to make changes:</strong></p>
<p>The PHP installer does not really handle changes all that well. For one thing it will overwrite the path to the PHP executable w/ the old DOS format so you need to fix that after you run it.</p>
<p>The 2nd thing is that it will write changes to C:\Program Files\PHP\php.ini &#8211; regardless of the fact that PHP is actually looking at C:\Windows\php.ini</p>
<p>If you had previously moved php.ini to the windows folder, when you run the Change installation feature, it will create a fresh php.ini file that only incorporates the most recent changes. (ie, if you had 10 extensions enabled and you make a change to enable 1 more, your new php.ini file will only have the 1 enabled and the previous 10 will no longer be enabled)</p>
<p>One way around this is to temporarily move C:\Windows\php.ini file to C:\Program Files\PHP. Then run in installer to make changes. The installer will write changes to php.ini in that location. Then, move php.ini back to C:\Windows.</p>
]]></content:encoded>
			<wfw:commentRss>http://verysimple.com/2008/01/05/php-on-windows-2003-iis-6-displays-404-page-not-found/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Introducing Phreeze PHP Framework</title>
		<link>http://verysimple.com/2007/10/14/introducing-phreeze-php-framework/</link>
		<comments>http://verysimple.com/2007/10/14/introducing-phreeze-php-framework/#comments</comments>
		<pubDate>Sun, 14 Oct 2007 07:15:35 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.verysimple.com/blog/2007/10/14/introducing-phreeze-php-framework/</guid>
		<description><![CDATA[We are proud to announce the release of Phreeze Framework for PHP.Â  Phreeze is an open source framework that allows PHP developers to generate a working web application in just a few clicks.Â  The generated application includes ExtJS DataGrids with AJAX pagination and sorting and server-side validation implemented, and a forms with server-side input validation. [...]]]></description>
			<content:encoded><![CDATA[<p>We are proud to announce the release of <a href="http://www.phreeze.com/" target="_blank">Phreeze Framework</a> for PHP.Â  Phreeze is an open source framework that allows PHP developers to generate a working web application in just a few clicks.Â  The generated application includes <a href="http://extjs.com/" target="_blank">ExtJS</a> DataGrids with AJAX pagination and sorting and server-side validation implemented, and a forms with server-side input validation.</p>
<p>The ORM component of Phreeze has been developed internally by VerySimple over the course of five years and powers several of our client&#8217;s web applications.Â  Phreeze powers several of our clients&#8217; web application and has proven to be an efficient and stable ORM for large datasets and high volume usage.Â  The MVC component of Phreeze is a new addition, but is already stable for production use.Â  The MVC uses <a href="http://smarty.php.net/" target="_blank">Smarty </a>template engine for view rendering, which is easy for developers and non-programmer designers to customize.</p>
<p>Basic API documentation and a support forum is currently online.Â  Tutorials and examples are coming soon.Â  The code is licenced under the LGPL which means you can use it for any purpose for no charge -including commercial applications.Â  A video demo is also available if you want to see an application being generating before you try it.Â  Phreeze is now a community project so please feel free to pitch in with any ideas or suggestions.</p>
]]></content:encoded>
			<wfw:commentRss>http://verysimple.com/2007/10/14/introducing-phreeze-php-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing PHP To Run on Both IIS and Apache on Windows</title>
		<link>http://verysimple.com/2006/03/30/installing-php-to-run-on-both-iis-and-apache-on-windows/</link>
		<comments>http://verysimple.com/2006/03/30/installing-php-to-run-on-both-iis-and-apache-on-windows/#comments</comments>
		<pubDate>Thu, 30 Mar 2006 10:00:00 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=9</guid>
		<description><![CDATA[Installing PHP to run on Windows through IIS is pretty simple because there is an installation wizard that does everything for you. But, those of us who also have Apache running for development need to have Apache process PHP pages too. This is a walkthrough to get both running. This will run PHP in CGI [...]]]></description>
			<content:encoded><![CDATA[<p>Installing PHP to run on Windows through IIS is pretty simple because there is an installation wizard that does everything for you.  But, those of us who also have Apache running for development need to have Apache process PHP pages too.  This is a walkthrough to get both running.</p>
<p>This will run PHP in CGI mode for both IIS and Apache.</p>
<p>1. Download from www.php.net the Windows Installer version of PHP AND the Windows &#8220;manual install&#8221; .zip distribution.  (If you already have PHP running for IIS, then you only need the zip version)</p>
<p>2. Run the PHP installer.  Install it to its default location of C:\PHP.  PHP should now be working with IIS.</p>
<p>3. Move the file C:\PHP\php.ini-dist to C:\Windows\php.ini</p>
<p>3. Unzip the &#8220;manual install&#8221; distribution.  You&#8217;ll notice that it has much of the same files as are already in C:\PHP.  Move all the of extra directories contained in this .zip to C:\PHP</p>
<p>4.  Download and install Apache HTTP server from www.apache.org.  (I used version 2).  Default install location is C:\Program Files\Apache Group\Apache2.  The configuration you use is up to you, but i specify in the install wizard to run Apache manually on port 8080 so that it will co-exist with IIS (which is already on port 80).  Then after that is done, I install it as a service by executing the command-line command:  apache -k install<br />
(from within the apache2\bin directory)</p>
<p>5. Edit the Apache configuration file C:\Program Files\Apache Group\Apache2\httpd.conf &#8211; make the following changes:</p>
<p># search for &#8220;DirectoryIndex&#8221; and add index.php to the end:<br />
DirectoryIndex index.html index.html.var index.php</p>
<p># search for &#8220;ScriptAlias&#8221; and add the following lines in that section:<br />
ScriptAlias /php/ &#8220;c:/php/&#8221;<br />
AddType application/x-httpd-php .php<br />
Action application/x-httpd-php &#8220;/php/php.exe&#8221;</p>
<p>6. restart Apache and the new configuration should take effect.  create a test PHP file and see how it works.</p>
<p>* caveat: if you use the same browser and surf back-and-forth between IIS and Apache, you may get a bunch of weird error messages about permission denied while writing session files.  This is because Apache and IIS run as different users &amp; they will block each other from writing to the same session file.</p>
]]></content:encoded>
			<wfw:commentRss>http://verysimple.com/2006/03/30/installing-php-to-run-on-both-iis-and-apache-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fatal error: Maximum execution time of 30 seconds exceeded</title>
		<link>http://verysimple.com/2006/03/30/fatal-error-maximum-execution-time-of-30-seconds-exceeded/</link>
		<comments>http://verysimple.com/2006/03/30/fatal-error-maximum-execution-time-of-30-seconds-exceeded/#comments</comments>
		<pubDate>Thu, 30 Mar 2006 10:00:00 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=41</guid>
		<description><![CDATA[When PHP is processing a file upload and you receive the error message &#8220;Fatal error: Maximum execution time of 30 seconds exceeded&#8221; it is because the script has timed out. I was working on an application where this was occuring during a file upload. The entire file would be uploaded, then the error would be [...]]]></description>
			<content:encoded><![CDATA[<p>When PHP is processing a file upload and you receive the error message &#8220;Fatal error: Maximum execution time of 30 seconds exceeded&#8221; it is because the script has timed out.  I was working on an application where this was occuring during a file upload.  The entire file would be uploaded, then the error would be displayed</p>
<p><a href="http://verysimple.com/wp-content/uploads/2010/04/phpini.png" rel="shadowbox[post-41];player=img;"><img class="alignright size-medium wp-image-547" src="http://www.verysimple.com/blog/wp-content/uploads/2006/03/phpini-300x138.png" alt="" width="300" height="138" /></a>Various websites instruct you to call set_time_limit() on the upload page.  This overrides the <strong>max_execution_time</strong> setting which is found in php.ini.  Calling this function on my upload page seems to have no effect on my server.  Changing <strong>max_execution_time</strong> in php.ini to 0 is supposed to be an unlimited timeout.  However i was still receiving the error message.  It would say &#8220;Fatal error: Maximum execution time of 0 seconds exceeded&#8221; which does not make any sense to me at all.</p>
<p>I discovered that, in addition to <strong>max_execution_time</strong> there is an additional setting <strong>max_input_time</strong> which controls how long a php file can spend processing the request data.  When i set <strong>max_input_time</strong> to a higher value, the problem goes away.  So, it appears that the error message is reporting the wrong configuration variable.</p>
<p>These settings are found in php.ini, however depending on your host you may be able to override them either in your script or in an .htaccess file.   After you update php.ini you may have to restart your https server process to reload the php settings.  (windows servers may need to recycle the application pool).</p>
]]></content:encoded>
			<wfw:commentRss>http://verysimple.com/2006/03/30/fatal-error-maximum-execution-time-of-30-seconds-exceeded/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
	</channel>
</rss>
