Category: OSX

  • Mac OSx High Sierra Homebrew switching between [email protected] and [email protected]

    Homebrew recently deprecated the repo https://github.com/Homebrew/homebrew-php as of March 31st, 2018.
    So, how do you install [email protected], and/or [email protected] (or @7.0, or @7.1, these are untested, but I assume will work).
    I work on some legacy sites, that require switching between the versions.
     
    So, lets run through this… I’m going to assume you cleaned up the old version of PHP.

    # clean up the old PHPs.
    $> brew uninstall uninstall php72 php56

    # append whatever options you may want. maybe –with-httpd
    $> brew install [email protected]
    $> brew unlink [email protected] –force
    $> brew install [email protected]
    $> brew unlink [email protected] –force
     
    modify you’re httpd conf, to accept your desired version of PHP you want to run.
    /usr/local/etc/httpd/httpd.conf

    #LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
    LoadModule php5_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp5.so

    If you run
    $> php -v
    it will fail.
    $> php -v
    -bash: /usr/local/bin/php: No such file or directory

    This is because we unlinked both versions.
    Say we want to use PHP version 5.6
    $> brew link [email protected] --force
    Now when we php 5.6 as our cli PHP.
    $> php -v
    PHP 5.6.35 (cli) (built: Mar 31 2018 20:21:31)
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

    If you want php5 to run in apache.
    ensure that php5 module is enabled in httpd.conf, and restart apache/httpd deamon.
    $> sudo brew services httpd restart
    NOTE: You need to run with sudo, if your http port is below 1000, or was that 1024… I forget.
     
     
    If you want to switch back to [email protected],

    1. unlink,
    2. change httpd.conf to use php7.2
    3. restart apache

     
     
    Also, if you want to install xdebug,or memcached use pecl.
    for [email protected]
    $> pecl install xdebug-2.2.0
    for [email protected]
    $> pecl install xdebug
     
    If you want memcached:
    with [email protected] (as of writing this, 2018-04-10)
    brew install libmemcached
    brew install pkg-config<
    pecl install memcached-2.2.0

    use: /usr/local/Cellar/libmemcached/1.0.18_2 for the memcached location.

  • Autel maxitpms pad on a mac? Yes, and no.

    Can you run Autel MaxiTPMS Pad on a mac? Directly, no. Through virtual box, yes.

    1. Install virtualbox and Oracle VM VirtualBox Extension Pack, both from: https://www.virtualbox.org/wiki/Downloads
    2. Download the windows 10 trial image/iso/dmdk/ovf, which is free, from Microsoft. linke: https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/
    3. After you’ve unzipped the image
    4. Double click the ovf to launch it with virtualbox.
    5. Ensure you add USB support when you setup the image.
    6. you may need specify which device, so that the image can recognize the TPMS pad.
    7. Download the latest MaxiTPMS pad software from: https://www.auteltech.com/TPMS Diagnostic & Service Tool/533.jhtml
    8. Run and install as normal windows app.
    9. It’ll self update probably, once or twice. Ask you to reboot your image.
    10. Once the reboot happens, you can then finally update your MaxiTPMS pad.

     
    And you’re done.

  • rsync target permissions and ownership

    Add these flags, to set the target permissions, and ownership
    –chmod=a+rwx,g+rwx,o-wx
    –chown=OWNER:GROUP
    the chmod is 774.
     
     

  • xdebug.ini with phpstorm

    [Server xdebug.ini file]

    zend_extension=xdebug.so
    xdebug.remote_enable=true
    xdebug.remote_connect_back = On
    xdebug.profiler_enable=1
    xdebug.profiler_output_dir="/tmp"

    Zero config phpstorm xdebug mode will now work.
     
     
    [Ensure your router isn’t blocking xdebug]
    Port Trogger is turned on

    • Trigger port: 80/tcp
    • Incoming port 9000/tcp

    OR
    Set your local machine as the DMZ
    OR
    Port forwarding

  • mac ports php rsync version not default

    You have a mac, and you’ve discovered that you want to install later versions of software that aren’t default on the Mac.
     
    Say, python 3.x, a newer version of PHP, curl, rsync… etc.
    you’ve installed them, and they reside nicely in /opt/local/bin
    but whenever you’re in the shell, they aren’t being used… what gives?
    run the following command:

    $> hash -r

     
    it’ll clear your executable cache.
    prior to running hash -r,

    $> php --version

    shows up 5.4.9

    $> hash -r
    $> php --version

    shows up php 5.5.11