Ramblings on technology with a dash of social commentary
RSS icon Email icon Home icon
  • Face Facebook Sharing Security Head On

    Posted on August 31st, 2011 phpguru No comments

    Sharing Policies on Facebook just got an upgrade. I thought you might like to see the new enhancements.

    1. Say who your with. Right off the bat, you can select the friends you want to be involved with a particular stream or conversation.

    2. Add Location to your posts. You can now define places where your conversation has relevance.

    3. Control privacy when you post – or after. If you realize a conversation might be better kept between certain people, you can now change the way your wall posts are published during or after the conversation starts.

    Visit this page on the Facebook.com Help pages For a more in-depth look at how to use Facebook’s newer, more secure sharing features.

  • How to Add Products to your Home Page in Magento

    Posted on August 28th, 2011 phpguru No comments

    In just 10 easy steps!

    Here are the steps:
    1. Download Magento and get it set up and running on your local box or web hosting account. I wrote about that before.
    2. Login to the backend in one browser tab, and load up your frontend in a new window.
    3. Turn off caching on the System -> Configuration screen.
    4. Configure your default store, or copy the default theme (or better yet, follow this tutorial to create a new Magento theme as your_interface/your_theme)
    5. Go to  System -> Manage Stores -> Website, Store, Store Layout and create one, point it to your_interface/your_theme
    6. Configure at least one Category and activate it.
    7. Configure at least one Product, assign it to the active category, and set it to enabled. Add Inventory of more than zero, and change Out of Stock to In Stock on the product editor.
    8. Assign the product to a website by checking the product on the Manage Products list and choosing Update Attributes in the upper right-hand corner. On the Manage Product -> Update Attributes screen is a right-hand tab that says “Website”. Choose that and check the store(s) you created in step 2 to assign the product to the website.
    9. Edit your Home Page content to have the following code, where 2 is Category ID shown on the Manage Categories -> Edit Category page.
    10. Go back to the Home Page browser tab and hit refresh (option refresh to force reload, in some browsers, or to be sure, clear your browser cache first).

    If this isn’t very clear, please watch this great screencast by Scott W on Vimeo.  In less than 10 minutes it will all be clear.


  • Zend & RightScale: The Ferrari of PHP Deployment has Arrived

    Posted on August 15th, 2011 phpguru No comments

    Zend Server is already the Cadillac of PHP Application Servers.

    The Ferrari of PHP Application Deployments has arrived.

    At least some, if not many PHP application developers are comfortable maintaining an Apache-based web server on Linux, the critical hardware that most often drives the web. Apache is free, and PHP is free, but you can’t be afraid to roll up your sleeves and get your hands dirty if you need to upgrade your software, install a new module, or tweak your server config.

    Most, if not all PHP developers are familiar with Zend, the engine that powers the PHP scripting language interpreter, and many great sites are developed using the Zend Framework.

    Zend PHP Cloud Platform on RightScale

    The Zend Framework is an enormous collection of ready-to-go building blocks (object-oriented PHP classes) for building just about any type of web application. There’s no question that their Zend Studio IDE ($299, built on Eclipse) is a solid PHP development platform, and Zend Server ($1,195 and up for support licenses) provides a terrific web-based GUI for managing your development, staging or production server’s LAMP stack.

    A little pricey, maybe, but if you rely on a LAMP environment for your deployed software applications and you don’t have a lot of time or resources to be fiddling with your server software, Zend solutions still are excellent product choices to rely on from the company most closely associated with PHP development.

    In today’s inbox, Zend announced a partnership with RightScale. If you’re not already familiar with RightScale, their service piggy-backs onto Amazon AWS to give you a nice, clean, friendly UI to manage and deploy webscale applications in the cloud. If you’ve ever experimented with Amazon AWS, you know it can be a little confusing and cumbersome to manage multiple server configurations as they scale.

    "Considering PHP's ubiquity on the web, it wasn't a question of it embraced the cloud, but when," said Stephen O'Grady, Principal Analyst with RedMonk. "With the recently announced RightScale/Zend partnership, the two companies are offering PHP users the best of both worlds, with the time to market of Platform-as-a-Service (PaaS) and the flexibility of Infrastructure-as-a-Service (IaaS)."

    With RightScale, you can save server templates and security group configurations, manage users and more. In the same way that Jenkins can help you automate testing your PHP applications and delivering them seamlessly to your server environments, RightScale can help you manage multiple-server cloud server application architectures with ease. Really a big time-saver.

    Definitely not cheap, but absolutely worth checking out if you have a decent budget and need to save time managing PHP cloud deployments.

    Scalable, Flexible, Portable PHP in the Cloud

    RightScale and Zend recently introduced a solution to provide a best practices path to launching and maintaining highly-available PHP applications in the cloud. Learn more about the RightScale and Zend Solution Pack: attend our webinar on August 17.

    Join us on August 17 for a demo of this new cloud solution that
    enables you to:


    Provision a pre-configured, high availability PHP environment
    in minutes
    Autoscale your application based on system and application
    load metrics
    Receive system, server and application-level monitoring,
    alerting and diagnostics
    Abstract your application from underlying cloud infrastructure to
    enable future portability 

    Topic: Introducing “PaaS in a Box”: Scalable, Flexible, Portable PHP in the Cloud
    Date: Wednesday, August 17
    Time: 9 AM PT / 12 PM ET / 5 PM BST / 6 PM CEST
    Speakers: Uri Budnik – Director ISV Partner Program, RightScale
    Claudio Gentile – Sales Engineer, RightScale
    Kevin Schroeder – Zend Technology Evangelist, Zend





  • How to install PHP APC extension on Snow Leopard

    Posted on August 11th, 2011 phpguru No comments

    I followed several posts on the Apple Suppor forum to install APC on Snow Leopard (not Server, but this forum seems much more appropriate as I am using Snow Leopard on my local MBP 17 for serious web development, trying to match my Ubuntu Server config as closely as possible.)

    Most notably, these:


    as well as


    I had to instal PCRE 8.12 before APC 3.1.9 install would work. Wincent has perfect instructions for that.

    Now back in my APC source directory, doing phpize and ./configure resulted in test failures; I realized that the recommended way of installing APC is via pecl channel-discover pecl.php.net
    pecl install APC

    This succeeded: Build process completed successfully
    Installing '/usr/include/php/ext/apc/apc_serializer.h'
    Installing '/usr/lib/php/extensions/no-debug-non-zts-20090626/apc.so'
    install ok: channel://pecl.php.net/APC-3.1.9
    configuration option "php_ini" is not set to php.ini location
    You should add "extension=apc.so" to php.ini

    Okay, so I add extension=apc.so to php.ini and restart apache. sh-3.2# php -i | grep apc
    apc.cache_by_default => On => On
    apc.canonicalize => On => On
    apc.coredump_unmap => Off => Off
    apc.enable_cli => Off => Off
    apc.enabled => On => On
    apc.file_md5 => Off => Off
    apc.file_update_protection => 2 => 2
    apc.filters => no value => no value
    apc.gc_ttl => 3600 => 3600
    apc.include_once_override => Off => Off
    apc.lazy_classes => Off => Off
    apc.lazy_functions => Off => Off
    apc.max_file_size => 1M => 1M
    apc.mmap_file_mask => no value => no value
    apc.num_files_hint => 1000 => 1000
    apc.preload_path => no value => no value
    apc.report_autofilter => Off => Off
    apc.rfc1867 => Off => Off
    apc.rfc1867_freq => 0 => 0
    apc.rfc1867_prefix => upload_ => upload_
    apc.rfc1867_ttl => 3600 => 3600
    apc.serializer => default => default
    apc.shm_segments => 1 => 1
    apc.shm_size => 32M => 32M
    apc.slam_defense => On => On
    apc.stat => On => On
    apc.stat_ctime => Off => Off
    apc.ttl => 0 => 0
    apc.use_request_time => On => On
    apc.user_entries_hint => 4096 => 4096
    apc.user_ttl => 0 => 0
    apc.write_lock => On => On

    So now we know, from the command line anyway, PHP CLI is reporting it has APC installed.

    Now here’s the interesting part… from Apache (e.g. trying to run any local PHP file http://localhost/info.php for example) I just get a white page of death.

    If I comment that extension out and restart Apache, PHP files work again.

    Hmm, lets look at the error.tail -f error_log
    shows: Fatal error: Unknown: apc_fcntl_unlock failed: in Unknown on line 0

    I google that and find this bug report, where it is stated that a patch is available for apc_lock.h.

    I go back to the PECL APC source site and browse the sources in trunk, find the apc_lock.h file, download it, put it into my APC-3.1.9 source directory and run phpize
    make clean
    make install
    apachectl restart

    Note that `make clean` is the magic bit there since we already installed APC from these sources, we need to make a new fresh install from these same sources.

    Now everything is working happily again.

    Good luck with yours!

  • Matt Mullenweg’s Photos are in MY WordPress Database

    Posted on August 5th, 2011 phpguru No comments

    It may come as a surprise to you, just like it was to me, to find hundreds of personal photos from Matt Mullenweg’s trip to Alaska in MY WordPress blog database.

    Seriously, folks, this is rather rude in my opinion. I invite you to Check your wp_options table for instances of ma.tt and you may be quite surprised what you find.

    SELECT * FROM wp_options WHERE option_value LIKE '%ma.tt%'

    To be fair, the actual photos aren’t in my database, but useless links to them are. Apparently WordPress stores newsworthy feeds it receives (when is unclear – all day? when I login to wp-admin?) in the wp_options table.

    I’m shocked and somewhat horrified to find thousands of rows of this useless junk mucking up my WordPress database unnecessarily. I’m not sure there’s any way to inject malicious code into a database through a news feed that is automagically stored, but it sure seems like a potential security risk to me. If there’s a way to turn off this storing of feeds, I’d like to know.