FEEDING ADDICTION

HELLO, I AM SIXEIGHTZERO


AND I HAVE BEEN ADDICTED TO PHP SINCE 2003

Getting High On PHP // High On PHP has been feeding the addiction of developers since 2009. Sharing tips, tricks and code with the open-source community, High On PHP helps bridge the gap between devices and servers.

  • COMPARING ARRAY’S WITH PHP

    AUTHOR: // CATEGORY: PHP

    No Comments

    Extensive Array Compare

    function array_compare($weighted, $comparable){
    	return array_merge(array_diff_assoc($weighted, $comparable), array_diff_assoc($comparable, $weighted));
    }
    
  • PHP FATAL ERROR: CALL-TIME PASS-BY-REFERENCE HAS BEEN REMOVED IN

    AUTHOR: // CATEGORY: Articles, PHP

    No Comments

    http://php.net/manual/language.references.pass.php

    There is no reference sign on a function call – only on function definitions. Function definitions alone are enough to correctly pass the argument by reference. As of PHP 5.3.0, you will get a warning saying that “call-time pass-by-reference” is deprecated when you use & in foo(&$a);.

    Good

    function myFunc(&$arg) { }
    myFunc($var);
    

    Bad

    function myFunc($arg) { }
    myFunc(&$var);
    
  • IMPORTANCE OF MAKE CLEAN

    AUTHOR: // CATEGORY: *nix, Apache, Articles, MySQL, PHP

    No Comments

    The Issue

    Some System Administrators like to change application prefixes around for security, organization and other reasons. Sometimes, being to quick for their fingers, they may forget a step in the install process. Once the source is ready for ‘make’, your configure options have already been parsed and saved. Running ‘./configure’ multiple times without a ‘make clean’ could cause some unwanted behavior.

    Example

    In this example, ‘./configure’ was run on Apache source without a ‘–prefix’. The second time we ran it, we included a prefix of ‘/usr/local/apache-2.2′. As you can see, the default prefix is ‘/usr/local/apache2′, which carried over to the second make instance of Apache.

    /bin/sh /opt/httpd-2.2.22/srclib/apr/libtool --mode=install /usr/bin/install -c -m 755 libaprutil-1.la /usr/local/apache21/lib
    libtool: install: error: cannot install `libaprutil-1.la' to a directory not ending in /usr/local/apache2/lib
    make[2]: *** [install] Error 1
    make[2]: Leaving directory `/opt/httpd-2.2.22/srclib/apr-util'
    

    The Fix

    “Don’t be mean, use ‘make clean’”

    If you are running configure more than once, make sure you use ‘make clean’ between each ‘./configure’, ‘make’ and ‘make install’.

    Enjoy!

  • PATCHING MPM-ITK FOR APACHE 2.2.2X

    AUTHOR: // CATEGORY: *nix, Apache

    No Comments

    What is MPM-iTK?

    apache2-mpm-itk (just mpm-itk for short) is an MPM (Multi-Processing Module) for the Apache web server. mpm-itk allows you to run each of your vhost under a separate uid and gid — in short, the scripts and configuration files for one vhost no longer have to be readable for all the other vhosts. To read more, check out the mpm’s site: http://mpm-itk.sesse.net/

    Download Now

    Updated 4/16/2012

    Download the Monolithic Patch Here

    How To Use

    Follow the steps below to apply the patch.

    // Enter directory with apache source files
    wget http://www.highonphp.com/downloads/apache2.2-mpm-itk-2.2.22.patch
    patch -p1 < apache2.2-mpm-itk-2.2.22.patch
    autoconf
    ./configure --with-mpm=itk
    make
    sudo make install
    

    Comments and questions below!

    Enjoy.

  • GLAZE – QUICK WAY TO BAKE API’S

    AUTHOR: // CATEGORY: Articles, PHP

    3 Comments

    What is Glaze?

    Glaze is a newely launched service designed to take the legwork out of creating an API. It uses an easy-to-use, intuitive interface to guide you for the most part on how to create an API, controller, modifier and output data. We haven’t seen anything like this before, and it’s use comes in handy. You can get in touch with that at www.mobilefrosting.com or www.yumglaze.com. You can follow them on twitter at http://twitter.com/yumglaze.

    Initial Thoughts

    • Pricing – Pricing seems more than acceptable not only for the fact that you get an easy to use interface, but hosting too! They give you a “user.glazenet.com” URL to send all your requests to, and depending which plan, you can even use your own domain and SSL/Port
    • Interface – The interface really hits upon all aspects you can think of when develpoing an API. Glaze, which is made by developers, understands the flow of creating an API. They walk you through creating the controller which receives data, mapping input varaiables and data to your ‘modifiers’ and mapping said modifiers to the database.
    • Support – Being a project created by developers from the start, you are in good hands with support. You talk directly with the engineers who created and maintain the application.
    • Reporting – Built in you can track statistics on your application by using the API controllers most-frequently hit. They let you know which errors are commonly encountered, how many requests your application is serving a minute/hour/day/month, and they even let you export [planned for the next release]

    In Closing

    Honestly, we ate it all up! Glaze really is a great app, with a lot of potential. Just a little more tweaking and it will be the next big thing!

    Enjoy.

sixeightzero has been working with PHP since late 2003 developing websites, applications, appliances and utilities.

  • INTEGRATION

    MY PASSION

    There is nothing that I enjoy more when it comes to programming than integration. From SNMP, Linux and system administration to music, movie and image manipulation with the power of PHP, if it sounds interesting, I’ve given it a try.

  • DEVELOPER

    THINGS I'VE DONE

    I’ve worked on projects in the past which have included Bonsolo, PHP News, PHP News2 and others.

  • LIFE

    MY FAMILY

    The two things I enjoy most in life is being a husband and a father. When you’ve married the most amazing and beautiful lady in the world, and have amazing, smart and talented children, there’s nothing more you can ask for. Money can’t replace this happiness.

Address // Montgomery, NJ

Telephone. // (978) 464-1138

Please, write your name. Please, insert your e-mail address. Please, leave a message.