April 11, 2012 9:27 am

I recently ran into this issue.  I needed PHPUnit for a freelance project.  Unfortunately, PEAR seems to be the only way to install PHPUnit.  I could do a whole post just on what it took to get PEAR working, and maybe I will!  For now we will focus on another issue.

Normally in PEAR you can request a specific version of an app you want to install.  You’d think…

pear install phpunit/PHPUnit-3.5.15

…would give you verion 3.5.15, but the pear.phpunit.de host seems to force 3.6 onto your system. The only way to get 3.5.15 at this point is to uninstall PHPUnit-3.6.x and all of its dependencies in the correct order then installing them each manually, again in the correct order.

Here is the magic incantation:

pear uninstall phpunit/PHPUnit
pear uninstall phpunit/DbUnit
pear uninstall phpunit/PHP_CodeCoverage
pear uninstall phpunit/File_Iterator
pear uninstall phpunit/PHP_Timer
pear uninstall phpunit/PHPUnit_MockObject
pear uninstall phpunit/Text_Template
pear uninstall phpunit/PHPUnit_Selenium
pear uninstall pear.symfony-project.com/YAML
pear uninstall phpunit/PHP_TokenStream
pear clear-cache
pear install pear.symfony-project.com/YAML-1.0.2
pear install phpunit/PHPUnit_Selenium-1.0.1
pear install phpunit/Text_Template-1.0.0
pear install phpunit/PHPUnit_MockObject-1.0.3
pear install phpunit/PHP_Timer-1.0.0
pear install phpunit/File_Iterator-1.2.3
pear install phpunit/PHP_TokenStream-1.0.1
pear install phpunit/PHP_CodeCoverage-1.0.2
pear install phpunit/DbUnit-1.0.0
pear install phpunit/PHPUnit-3.5.15


December 29, 2011 2:34 pm

While working on some SEO stuff, I discovered that some pages on my site were returning 404 to Google’s web crawler.  These sites were all working fine in browser.  To make matters worse, this was only occurring on my site and not another site I’ve recently worked on (www.mariarajewski.com).

I busted out cURL, and fetched the URL.  Sure enough, I get a 404 response code…

C:\Users\will\Downloads\curl-7.22.0-win64-ssl-sspi>curl -v http://squidgle.local
/about
* About to connect() to squidgle.local port 80 (#0)
*   Trying 127.0.0.1... connected
> GET /about HTTP/1.1
> User-Agent: curl/7.22.0 (amd64-pc-win32) libcurl/7.22.0 OpenSSL/0.9.8r zlib/1.
2.5
> Host: squidgle.local
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Date: Thu, 29 Dec 2011 19:19:07 GMT
< Server: Apache/2.2.16 (Win32) mod_ssl/2.2.16 OpenSSL/0.9.8o
< X-Powered-By: PHP/5.3.8-ZS5.5.0 ZendServer
< Set-Cookie: ZDEDebuggerPresent=php,phtml,php3; path=/
< X-Pingback: http://squidgle.local/wordpress/xmlrpc.php
< Expires: Wed, 11 Jan 1984 05:00:00 GMT
< Last-Modified: Thu, 29 Dec 2011 19:19:19 GMT
< Cache-Control: no-cache, must-revalidate, max-age=0
< Pragma: no-cache
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=UTF-8

Interestingly, cURL still fetched the entire page contents as well.  Oh Hamburgers!

The page was built with Zend Framework MVC.  I tried manually setting the response code in the Controller via:

$this->getResponse()->setHttpResponseCode(200);

Alas, still the dreaded 404 error!  This issue must be occuring somewhere between the Controller and the View.  I succumbed to the temptation of using a quick fix by manually setting the response code in the view itself with:

 <?php header("HTTP/1.0 200 OK"); ?>

That seems to have fixed it…

C:\Users\will\Downloads\curl-7.22.0-win64-ssl-sspi>curl -v http://squidgle.local
/about
* About to connect() to squidgle.local port 80 (#0)
*   Trying 127.0.0.1... connected
> GET /about HTTP/1.1
> User-Agent: curl/7.22.0 (amd64-pc-win32) libcurl/7.22.0 OpenSSL/0.9.8r zlib/1.
2.5
> Host: squidgle.local
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Thu, 29 Dec 2011 19:31:02 GMT
< Server: Apache/2.2.16 (Win32) mod_ssl/2.2.16 OpenSSL/0.9.8o
< X-Powered-By: PHP/5.3.8-ZS5.5.0 ZendServer
< Set-Cookie: ZDEDebuggerPresent=php,phtml,php3; path=/
< X-Pingback: http://squidgle.local/wordpress/xmlrpc.php
< Expires: Wed, 11 Jan 1984 05:00:00 GMT
< Last-Modified: Thu, 29 Dec 2011 19:31:07 GMT
< Cache-Control: no-cache, must-revalidate, max-age=0
< Pragma: no-cache
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=UTF-8

I don’t feel good about the fix, it seems like a hack.  If anyone has run into an issue like this before though, I’d love to hear how it was resolved!



December 26, 2011 5:06 pm

I recently updated the WordPress back-end of my blog from version 3.2.1 to 3.3.  This borked all of the permalinks to my blog entries.  They went from www.squidgle.com/post/# to www.squidgle.com/wordpress/post/#.  While this may seem like a trivial change, I won’t have it and I won’t stand for it!

How to downgrade WordPress from 3.3 to 3.2.1:

  1. Download the WordPress 3.2.1 package here – http://wordpress.org/wordpress-3.2.1.zip
  2. Unzip the package to a directory of your choice.
  3. Using an FTP client, Copy/Replace everything EXCEPT the wp-content/ directory from the package into the wordpress/ directory on your server.
  4. Try to log-in to your WordPress site.  It will ask you to upgrade the database.  Just click “Upgrade” and the process should be complete!
  5. Enjoy WordPress 3.2.1!


RSS Feed
Google+
stackoverflow.com profile