Blog posts by Geekyboy – Adam Culp

  • Sharing the Beachcasts office and studio set up

    I thought I’d share my office set up, and what equipment I use for my various recordings and video productions. Since I do podcasts (RunGeekRadio), live streams (Beachcasts on Twitch), and video recordings (Beachcasts on YouTube), I needed a versatile setup facilitating all of these various activities. So, below I will share each aspect of my office/studio, and how I have it set up.

    NOTE: I will return to this post from time to time and update it as I update equipment, to serve as a resource to point folks at.

    First, here is what takes up 6 feet wide by 5 feet deep space of my office. I often hear folks say they can’t do what I do because they don’t have space. Though, in reality, it is pretty compact. (Technically, that space is doubled if you include my background.)

    Studio Setup

    I use laptops, and desktop, and one external monitor.

    Everything sits on an adjustable desk from Ikea. I really love this desk for its simplicity, along with being able to hide all the cords underneath because of the handy cord hammock attached below. Plus, it is motorized, making it a breeze to raise or lower. I typically set it to 26 inches high when sitting, and 43 inches when standing. Then, I simply pull the standing mat forward, and I continue working in a very similar way whether sitting or standing.

    Computers and Software

    My primary desktop computer is a homemade system. With an AMD Ryzen 9 5900X 12-Core CPU, MSI Nvidia GeForce Ventus RTX 2060 Super, 32 GB RAM, and 2 x 1TB M2 SSD modules, it is able to handle anything I throw at it even at 6 years old. All that is mounted on the MSI MAG Tomahawk x570 motherboard, which runs very cool…even under load. I run Windows 11 as the primary OS and do anything I want to on it, using WSL2 for much of my development and Docker hosted solutions. I’d used Ubuntu as my OS for 12 years but recently switched to Windows 11 in early 2021. It has improved much from the past, especially with WSL2 capability for development. LEDs are on the fan, motherboard, RAM, and SSDs.

    NOTE: Though this image below and the description above indicate it has an AMD stock fan, I’ve since upgraded to a Noctua NH-D15. Though my case is too small for the double fan setup, I use a single fan and it runs very cool.

    Desktop system

    I do all my audio recordings on this desktop using Audacity software.

    With this desktop, I use a Maxkeyboard Nighthawk X8 mechanical keyboard with Cherry MX brown switches. I like the mechanical keyboard feel and feedback, and the brown switches give me just enough noise to enjoy the experience. There is a slight clicking, but not as clicky as the blue switches. I recently purchased some rubber rings to install on each key, so the bottoming-out noise will not bother others when I’m on conference calls. I haven’t installed them yet.

    I also use a Logitech M510 wireless mouse. It uses 2 AA batteries, and charges really quickly. It has been a solid performer and is very reliable.

    My beautiful monitor is a Samsung C43J89x 43-inch ultrawide curved 120Hz model with picture-in-picture capability and built-in KVM using a USB-C connector. It operates at 3840×1200 resolution and is like having dual monitors. It’s wonderful.

    The monitor is mounted on a Humanscale M8 monitor arm, which is wonderful and strong. I get only minimal movement from it, even with such a large/heavy screen mounted on it. A new monitor will be much lighter and will be truly amazing.

    The second (work) laptop is a 16″ MacBook Pro mounted on a Roost laptop stand. The Roost was recommended to me by a few friends in the programming space, and it has been amazing. However, you will want an external keyboard and mouse to go with it, as it is hard to type when a laptop is raised from the table. So, next, I will talk about those.

    The external keyboard is the Apple Magic Keyboard, which is wireless and connects via Bluetooth. The feel of typing on it is really nice, and has a mechanical “feel”. Kinda like the old-style Macbook Pro keys, before they ruined them with butterflies. It charges via USB connection to the laptop, and only needs charged every 3 months.

    Instead of a mouse as an external for the Mac I use the Apple Magic Trackpad. It is larger than the trackpad on the Mac, and has all the same features, including Force Touch feedback to simulate a click. It is also Bluetooth and only needs charged every 3 months.

    NOTE: Since upgrading the laptop to Apple silicone, I’ve had to upgrade the keyboard and trackpad to the newer version 2.

    How does my recording and streaming setup work?

    Since upgrading from an old Dell laptop to a new desktop, I now record everything I do on the desktop using OBS. In the past, I used multiple laptops for recording and streaming due to the intensive nature of it. However, the desktop allows me to utilize a single system to do all the things.

    Audio and video equipment for recording and streaming

    Also for a video cam, I use a Logitech Brio. At 1080p and 30 fps, it does a great job, though the Brio can be costly. I also have multiple Logitech C920 webcams used for additional scenes. I have 2 of them, and sometimes incorporate them as additional views in b-roll footage. They are also handy when I travel, with an extra little hard case I picked up. They are all very versatile webcams. (I’ve added a Nexmo lens cover that can be opened/closed because I bought this up before they came out with the C920S that comes with a privacy cap.)

    Logitech Brio 4K webcam
    Logitech Brio 4K
    Logitech C920 webcam
    Logitech C920 webcam

    As for audio, I have 2 different configurations. For podcasting, and YouTube videos, I use the Rode Podcaster as my primary microphone. The sound is amazing, and hard to beat. I have it mounted on a Rode PSA1 studio boom arm, with a Rode PSM1 shock mount to prevent desk movement vibrations and sounds. It also has a Rode WS2 pop filter to help keep the audio crisp and free of pops from my talking.

    Rode Podcaster
    Rode Podcaster

    It connects via USB to the Dell and has an external headphone jack on the top that allows me to hear myself, and any system sounds, while I’m recording. As a dynamic mic, it is very directional and requires me to speak directly into it. This avoids any other background noises, like keyboard typing or air conditioning hums.

    Additional audio is provided by a Rode Wireless Go setup. I’ve been using it for live streaming, so I’m not required to be close to the larger Podcaster mic. I also picked up the new Rode Lavalier Go to enable me to clip it on my t-shirt for ease of use, and then clip the Wireless Go on my belt. I picked up an added SC7 cable for connection to a mobile device or Mac.

    Wireless Go
    Wireless Go with SC7 cable
    Lavalier Go
    Lavalier Go

    Recently, I also added some Audimute acoustic panels on the wall behind my monitor. In the past, I fought to remove the echo from the flat wall. I’m really impressed with how much the panels reduce the echo. Originally, I considered ugly “egg carton” style foam. However, I found they did little to really help, which resulted in spending a little more money on proper panels.

    Lighting I use for video recording

    As the last bit of equipment, this would not be complete without talking about lighting. In addition to overhead lights, and natural light coming from the large window beside my desk, I’ve added some face lights that help eliminate shadows, and enable the webcam to do a much better job. In mid-2021 I picked up some Elgato Key Lights when they were on sale. (They can be seen in the header image at the beginning of this post.)

    But in the past, I used light created with a few parts. First, there are 2 inexpensive tripods to use as holders. Each one holds a square Tolifo LED panel light that has adjustable brightness. (here are the power adapters to go with them)

    Tolifo LED light
    Tolifo LED light

    However, I found that even at lower levels the light was a little harsh and needed some diffusion. That is when I picked up the added panels and arms to hold them. This made all the difference in the quality of light, and means I do not have blaring light forced into my eyeballs. Yay, I can actually see the displays! It is very soft and provides a great spread.

    Extra note about the Bluetooth speaker

    Some may have noticed the additional Bluetooth speaker on the desk. This is the JBL Charge 3, which is connected to a Google Chromecast Audio and plays music most of the time each day. It has great sound, but I don’t think either of these things is produced any longer.

    Closing

    I hope you found this enlightening/helpful. Let me know if there are any other aspects of the setup you’d like more details on. And watch for a future post on how I set up OBS.

  • 10 reasons to become a consultant or have a consulting business

    In this video, I share 10 good reasons to start a consulting business or become a consultant. However, before you start looking into how to become a consultant, Adam Culp of Beachcasts PHP videos shares points from his experience to help you figure out if being a PHP consultant is the right job for you. So, as you look into how to become a consultant, and before you become a consultant, consider these things carefully.

    Or you can view this video on YouTube at: https://youtu.be/J7gpMYAKmDM

    Items:
    #10 Multiple Hats
    #9 Constant New Problems (to solve)
    #8 Always Learning
    #7 Helping (mentoring) People
    #6 You’re The Fixer
    #5 “Expert” vs “Resource”
    #4 Fame!
    #3 Sell, Sell, Sell!
    #2 Travel
    #1 Flexible Schedule

    BONUS considerations for the self-employed
    #1 No Dress Code
    #2 Unlimited Earning Potential
    #3 Unlimited sick days/vacation
    #4 Flexible Work Location
    #5 Freedom to say “No” or turn down jobs

  • Zend Framework becomes Laminas project

    Today it was announced that Zend Framework is being rebranded as the Laminas project. (drawn from the meaning “a thin layer”) Along with the rebrand came some other important changes as well. Yes, this includes Expressive and Apigility, so continue reading.

    Some History

    Zend Framework is one of the largest and oldest PHP frameworks and has become a staple for enterprise development around the world. As of April 2019, it has over 400 million lifetime downloads of all packages associated with the project, which has seen a 4-fold increase in just the last 2 years alone. Despite this amazing track record, up to now the project has been supported and guided single-handedly by Zend Technologies, and later Rogue Wave Software.

    Awesome Changes

    Therefore, to continue this growth and receive the best support possible, the Zend Framework team is announcing that all projects under that umbrella will rebrand to a newly formed “Laminas” project“, which aims to continue its mission as an open source project hosted by the Linux Foundation. The transition will enable more companies to provide support for the projects they’ve come to depend on and help them continue to grow. As part of this transition, it is important for them to differentiate the open-source project from the Zend commercial brand. Therefore, the new name “Laminas” project was created.

    As part of this move, the Expressive microframework, Apigility API framework, as well as the MVC framework, will all be part of the Laminas project.

    I will try to add more details as they become available to us all, and will likely also do a Twitch stream and YouTube video with Beachcasts, and that video can be viewed HERE.

    Support Laminas Project

    For more information, please see the new site dedicated to the Laminas project, and if you would like to become a member and/or support the project at the Linux Foundation (their blog post), please join and become a member.

    Impact on current users

    The framework team is working on scripts and tools to help users update namespaces and vendor packages with the renaming. See the video below for more info.

    Beachcasts Video

    I added this, and a little more content about the Zend Framework rebranding to the Laminas project under the Linux Foundation. Check it out below.

  • 10 bad things about consulting, and why it might not be for you

    In this video, I share 10 bad things about being a consultant, and why a consulting job might not be a good fit for you. Adam Culp of Beachcasts shares points from his experience to help you figure out if being a PHP consultant is the right job for you.

    Or you can view this video on YouTube at: https://youtu.be/ELE0G3e7h3c

    Timeline:
    #10 Travel
    #9 No set schedule
    #8 No upward mobility
    #7 Not for the introverted
    #6 Communication, communication, communication
    #5 Swallowing pride
    #4 Always be selling
    #3 Problems!
    #2 Expected to “know it all”
    #1 No “new” projects

    BONUS considerations for the self-employed
    #1 accounting/collections
    #2 taxes
    #3 No sick days / vacation

  • How to get lines of code in PHP with PHPLoc via CLI or using Docker

    This video shows how to get the lines of code in a PHP application by using PHPLoc from the command line or using Docker. PHPLoc is a command line application to generate a small but useful report. Adam Culp will show how to use it from a Docker Container using a Docker Image he created. PHPLoc demonstrated on the Concrete5 CMS codebase.

    Key Topics:

    • Why find the lines of code
    • PHPLoc is an application to find the lines of code in PHP
    • Different methods to use PHPLoc
    • How to use a Docker image to run PHPLoc
    • Comments as a code smell

    Associated Links:
    https://en.wikipedia.org/wiki/Code_smell – Code smells explained
    https://www.docker.com/get-started – The place for developers to start with Docker
    https://hub.docker.com/r/adamculp/php-code-quality – link to the image used to build the Docker container used in this video
    https://github.com/sebastianbergmann/phploc – location of the PHPLoc tool
    https://www.concrete5.org/ – Concrete5 CMS code I’m using in this video

  • What is Enterprise Ready?

    First, let me clarify, this post is not about Star Trek and the starship we’ve all come to know. 😉 Further, this post is not to attack any one group, and rather is my (perhaps poor) attempt to help others gain some visibility into what large companies (Enterprises) do, or perhaps should, look for in software prior to using it.

    The Backstory

    I saw some rumblings over the weekend between various communities where members of one were accusing another of not being “Enterprise Ready”. Of course, the others quickly responded that their tools were already being used in that capacity, therefore, they were “Enterprise Ready”. (If it swims like a duck, it must be a duck.)

    Following this, I saw many more statements from various folks saying, “We are Enterprise, and we use it, and it’s working fine.”, and “What is ‘Enterprise Ready’ in any way?”

    I’m sorry folks, but just because a company “can” or “will” use a given tool doesn’t mean they “should”, and it certainly doesn’t mean a given tool is indeed ready for use in companies reporting to shareholders or having requirements to meet certain compliance thresholds.

    The Risks

    There are no definitive guidelines to clearly state what “Enterprise Ready” really means, and there are certainly no lists of which applications are, or are not Enterprise Ready.

    Sure, there are different regulations for security, legal, and financial compliance. But even these only scratch the surface and do not clearly define what can/should be used. Especially when it comes to the many open-source software packages available.

    In many ways, it can come down to what a company is comfortable with. How much risk they are willing to accept. And in some cases, how much liability they are willing to ignore and/or absorb when things go sideways.

    On other fronts, a company’s choices are led by the future. Large enterprises try to plan ahead because they know it is hard to change later down the line. Choices made today are often felt for 10 to 20 years, so it is very important to ensure they do not get caught in the trap of using tools lacking support and/or no longer getting security updates.

    How It’s Made

    I consult and work directly with, some of the largest companies in the world every day whom I consider “Enterprise” in size. Since there are no pre-made lists of tools that are definitely “Enterprise”, I will share what many of these companies look at when choosing a tool or software, prior to allowing it to be added to their portfolio for the next 10 years.

    The Requirements List

    So, off we go:

    • Licensing
      If software/code does not include a license, companies, and developers can’t use it. Making code public doesn’t automatically make it open for others to use. By default, all code is subject to copyright and private.Also, in the same vein, adding an open-source license doesn’t mean everyone can use it. Each open-source license carries certain criteria which can prevent companies from using the code behind them. So, be careful to understand the ramifications of the license applied to a software package.
    • Interoperability
      Enterprise-level companies have lots of software/code. I often see 4+ million lines of code in applications, not including 3rd party code and frameworks. This means that libraries must be able to work together in order to be used.In PHP, the PHP-Fig has worked hard for many years in an attempt to create conventions that, if followed, allow PHP libraries and frameworks to work together more easily. Therefore, Enterprise level companies tend to use code that follows the many PSR standards set by this body. Meanwhile, tools that do not follow these standards, regardless of how awesome, are rejected by Enterprises.

      Ask yourself, why should a company create internally maintained wrappers to facilitate “vendor lock-in” when another interoperable library doesn’t require such things?

    • Lock-in
      If packages of code do not work well with other packages of code and somewhat force the use of tools created by the same entity, this is known as “vendor lock-in”. Thinking back to the days before open source became viable for common use, I can’t help but remember struggles with IBM, Microsoft, Oracle, and others. If one of their tools was used it required me to use others, resulting in even more costly licenses.Even when software “appears” free, “vendor lock-in” can exist, and this leads toward limiting options in the long run. Enterprises are finding that less “vendor lock-in” in their applications means they can make better decisions and pivot faster. Therefore, monolithic frameworks and packages are becoming undesirable in the Enterprise. Decoupled middleware, microservices, and frameworks are the desired flavor of Enterprise Ready.

      I often speak with companies who say things like, “We want to switch to another framework, and we’ve chosen X.” But yet they can’t substantiate “why”. They use terms like “open” and “popular”, which prompts me to help them create a solid list of pain points leading them to their decision. Usually, we find the framework they were choosing will yield the same pain they desired to leave behind. The number one pain point is typically vendor lock-in.

    • Contributors
      Another very important consideration among Enterprises “in the know” is the number of active contributors to a given software package.More contributors mean more eyeballs on the code and often result in fewer bugs and security issues in a given package. And for Enterprises, it can also mean bugs get fixed faster, or new features get added more quickly.
    • Bus Factor
      The term “bus factor” is a rather cold term describing if the leaders are hit by a bus, and what the effect on a project would be.  If a popular package has a single “head”, and that person were to disappear for some reason, would the package continue without that person’s vision, drive, and direction?I know of many popular PHP packages that have plans in place to facilitate such a tragic event. The more popular a package gets, the more important this is. Of course, having such a plan doesn’t always mean the “bus factor” has been avoided. Often the leader is the glue that keeps it all together, and disruption can lead to the death of very strong communities. However, it is important to ensure these plans exist for true Enterprise adoption.
    • Documentation
      No matter how great a package is, or how widely it is adopted, documentation is important to ensure developers can use the tools provided. Some have said that a good developer can read the code and figure out how to use a framework, but that is not what leads to widespread usage. In order to gain true market share it is vital to have great documentation making it easier for anybody to use something.A truly strong community helps in this area and is self-fulfilling, as good documentation leads to more usage, and more usage leads to a stronger community, which aids in the creation of better documentation. Companies are more likely to use a package if documentation helps their developers create faster.
    • Support
      Despite how good documentation is, occasionally we all get stuck and need a helping hand. Eventually, for a great package to be leveraged by Enterprise it is required that an Enterprise can somehow reach out for support. In the early days of a library, this could simply be blog posts from “fanboys”, but for widespread use in Enterprises, it may mean more interactive things like phone or email support, consulting, and a “throat to choke” if things go wrong.Good support is multi-pronged: support boards, email, consulting, “fanboy” network, outside agencies available, and other forms of community forums.
    • Compliance
      If a package is performing activities with a database, filesystem, personal information or content, encryption, and authorization, there may be regulations in place that Enterprise level companies must be in compliance with.It is important to Enterprises that the code they will use also be compliant, or at a minimum make it easy for the company to remain compliant while still leveraging the package.
    • Longevity
      We all like the new and shiny. However, for Enterprises, this can be a negative. They require things to be a bit more tested, and “aged” in some cases. If a library has been around for a while it can mean a more mature API, fewer bugs, more security, and better documentation and examples.At the same time, if a package has been on the same version for too long it can also indicate stale and/or dead libraries that will someday no longer be supported.
    • Upgradeable
      How easy is it to upgrade the software from one version to the next, or how easy is it to upgrade from another library, are considerations prior to using a software package.

      Many leading packages go to great pains to prevent breakage between versions and provide documentation to allow users a step-by-step process for migration. I’ve even seen some create tools that handle the necessary pieces. A company must consider the past track record of a package prior to usage.

    • Roadmap
      Enterprise applications tend to stick around for a very long time. It is easy to find applications that have been around for 10 years or longer in some companies. Therefore, one thing companies look for is an accurate and active roadmap.

      A roadmap can indicate if there are good ideas being developed and if there are major changes coming in the future that a company may need to be ready for. It can also indicate when a package has lost its way and is no longer paying attention to its users, and an exit may be a good idea.

      In any way, a good roadmap is an easy way to keep Enterprises informed.


    I hope you found this post informational. Many developers struggle to understand what defines “Enterprise Ready”, or even why it is a thing to be considered. While there is no definitive list, I have attempted to share what the many Enterprise level companies I’ve consulted with look for.

    If I think of more points, or if others share something I feel is important enough, I will return here and update this.

  • Stop the pain, upgrade to PHP 7

    When I was young I played football at my local middle school…very terribly. I didn’t enjoy running with the heavy pads in the heat, and I definitely didn’t enjoy running into and hitting the other kids, most of which were larger than me. But in high school that all changed. Why? Because in middle school football was painful. Meanwhile in high school, well, it was still painful but there was something more pleasurable to offset the pain. It was the praises from the coach and the sounds of people cheering my name that truly made the difference.

    See, in middle school, the coach seemed to focus more on the larger kids who could bully others or the popular kids whose parents were the cornerstone of our small community. However, in 9th grade, it changed a bit because the coach was great at distributing his attention to the entire team. He would tell me “good job”, or “you can do better”, and he even let me play in a game while my skills were catching up. These are things I didn’t have before, and they made a huge difference. I came to love playing and worked harder than I ever had to stay first string all season long rather than being satisfied with sitting on the sidelines watching others play.

    So, now you may be asking, “What does this have to do with upgrading to PHP version 7?” The answer is that many are letting the pain of moving to PHP 7 prevent them from experiencing pleasure and rewards.

    PHP version 7.0 was released almost 2 years ago. (1 year and 10 months before this post to be exact.) And many are still running PHP version 5. something. As a matter of fact, PHP version 7.0 is already going to run out of active community support in only 1 month and will only receive security fixes for another year after that.

    You can see the supported versions of PHP at http://php.net/supported-versions.php

    The Pains

    I get it. Upgrading to a new major version is painful. There are backward compatibility issues that caused it to be a new major version, to begin with, and now we need to jump through some hoops without any good reason. I mean, the app already works, right?

    Add to this that there may be compatibility issues that have nothing to do specifically with PHP, but rather the individual libraries and packages we used in the past have not been updated yet. Dependency hell is only a step away.

    Also, how can we possibly endure the pain of explaining why we should upgrade to PHP version 7+ to management!?!

    So we should just give up. Perhaps remaining on PHP 5.4, 5.5, or 5.6 is not so bad after all.

    NO WAY! Read on!

    Acclimation

    Those pains aside, there are more that we’ve become acclimated to over time. We avoid upgrading because we’ve become used to the pain faced on a daily basis with what we currently have. It has become our comfort level. Meaning, we avoid the pleasures of advancing because we settle for what we already know.

    Pleasure

    In case you haven’t heard, PHP 7 brings a whole new level of FAST. Some companies have even recorded the speeds of some apps to double. You read that right, “Double the speed in some apps.” That means customers get served web pages in half the time. Internal employees are able to navigate intranets, accounting software, and other internal apps half the time. Imagine the productivity gains and reductions in salary required to have employees sitting at a screen waiting for the next page to come up. Imagine the customers who don’t click away from our products because it now loads faster!

    In addition, many companies also noticed their resources (servers) running PHP apps with PHP 7 have dropped drastically. (about half) Meaning they can serve the same PHP applications on half the number of servers they used previously. If a company was using 100 servers to do business, they are now able to do the same thing with only 50 servers! That is a saving of 50 fewer servers needing to be hosted. Imagine the carbon footprint impact of that!

    Note: Your mileage may vary, but many have shared real-time stats on this.

    Some supporting posts and stats:

    There are other pleasures of upgrading to PHP version 7.0. Among them are new features in the PHP language, such as scalar type declarations, return type declarations, null coalescing operator, spaceship operator, constant array using define(), anonymous classes, Unicode codepoint escape syntax, Closure::call(), Filtered unserialize(), IntlChar, Expectations, Group use Declarations, Generator Return Expressions, Generator Delegation, Integer division with intdiv(), Session options, preg_replace_callback_array(), and CSPRNG functions

    The upgrade to PHP version 7.1 brings pleasures in the form of even more performance improvements, as well as, Nullable types, Void functions, Symmetric Array Destructuring, Class Constant Visibility, iterable pseudo type, multi-catch exception handling, support for keys in list(), support for negative string offsets, convert callables to closures, asynchronous signal handling, and HTTP/2 server push support in ext/curl

    And PHP version 7.2 also looks to carry many more great things, as PHP 7.3 is gaining form.

    In Closing

    Yes, there may be a little pain in upgrading to PHP 7, but overall the good parts far outweigh the pain. You’ll be glad you did it.

    What are you waiting for? Get out there and feel good by upgrading your apps and servers to PHP 7 today!

    There is a great recorded webinar sharing more thoughts on migrating to PHP 7.

    Happy PHP’ing!

  • Easy Docker dev environments for PHP with CloudEstuary

    Lately I’ve been messing around with Docker, and specifically with containerizing PHP applications to perform quick services, such as static analysis of PHP code, compatibility of existing PHP code to specific versions of PHP, and performing security checks on PHP libraries included in my projects. However, I’ve not created a development environment for my projects using Docker.

    Like most professional PHP developers, I’ve been using Vagrant to create virtual environments for most of my development. It works fantastic, but one of the downfalls is that it leads to a large VM file for each virtual machine taking up disk space on my laptop. This is unfortunate for a consultant like myself, who creates a separate VM for each client.

    But today I found another way. A way to easily create PHP development environments with Docker. The fine folks at CloudEstuary have created an easy to use web-based tool to create PHP development environments (yml files) for use with Docker-compose.

    CloudEstuary

    The entire process was super easy, assuming we already have Docker and Docker-Compose installed.

    Create a Project

    To start I selected the framework, of which I decided to try this with the very popular Zend Framework in an application I’ve been working on, so I clicked the Zend Framework icon. The tool chosen will cause the runtime settings in the next section to be altered to accommodate.

    Next I added a custom name for my project and chose PHP 7.1 for the Runtime, but left the rest of the items set as default.

    Following that, there is a list of pre-existing Addons to be enabled as desired. It seems Postgres is selected by default, but it is simple enough to Remove it and select another solution if desired.

     Then the final step, as of this writing, was to add any workers if I desired. I’m not sure of the limits of what can be put there, but I’m sure documentation will be forthcoming.

    Then, finally, I was able to click the Generate Docker Compose button to receive the docker-compose.yml file. The final result was a brief explanation of what to do next, and of course, the file contents.

    The docker-compose file expects to be placed in a directory where the application to be served resides in an ‘html’ directory. Don’t worry, you can change this as needed. In my case I simply change the following portions of the yml file (3’ish places):

    To become:

    I placed the docker-compose.yml file to the root of my Zend Framework application. (on the same level as the composer.json file)

    Additionally, I have a local installation of Apache running on port 80, so the docker-compose file would not work for me out of the box. It sets the Nginx server port forwarding to expect the host port 80 to forward to the Docker container port 80. So I updated the ports from this:

    To become this:

    Use It

    Now I was ready to fire up the Docker container. I did this via CLI by navigating to the root of the application and issuing the docker-compose command.

    After a couple minutes of Docker fetching various images, the container was running. Note: the terminal continues showing what it happening inside the container. (Nginx and other apps logs are output to the terminal)

    Now I was able to pull up my awesome Zend Framework PHP app in the browser using the address http://localhost:8888

    Add Account

    One other nice feature of the site is the ability to create an account. I am told there will be more functionality around this later, but for now it allows you to see a list of all projects you’ve created, and enables you to edit the configurations.

    Simply click the link to create an account:

    Then you can see projects created while you were logged in via the “My Projects” menu item.

    Closing

    I hope you found this post helpful. Using Docker to create PHP development environments is easy. Enjoy!

  • Setting up local step debugging with Zend Studio

    Setting up debugging in an IDE with a local PHP development environment has gotten so easy it can be done in a couple automated steps. In this post I will demonstrate how to get step debugging functioning with Zend Studio and Zend Debugger when the server is set up on a local environment.

    To begin with, I had the following:

    • Local installation of Zend Server 8.5.+ (basic LAMP stack, but with Zend Debugger included in the Zend Server installation). Alternatively I could have had a vanilla LAMP environment with Xdebug.
    • Ensure that Z-Ray is active in the Zend Server settings.
    • A local project set up on Zend Studio, without the server set up in the Zend Studio project configuration. (in this example I have a Zend Expressive Skeleton ready)
    • The local project set up as an Apache virtualhost.

    Ensure Zend Studio is running with the project we will debug open.

    In a browser with the application rendered I click the debug icon in the Z-Ray toolbar at the foot of the window, and select the desired debugging action.

    This will cause Zend Studio to prompt if we desire to use the Debug Perspective after it receives the debug connection from Zend Debugger. In most cases we can simply click Yes and let things happen normally.

    That’s about it, we are debugging!

    Closing

    This was a very simplistic local development environment setup. We didn’t have a firewall to contend with, and the server was set up locally rather than inside a virtual machine. I have other posts, linked below, to help with some of these alternative setups.

    Happy Debugging!

    Other posts on Debugging you may find helpful:

  • Setting up local step debugging with PhpStorm

    Setting up PHP debugging in an IDE with a local development environment has gotten so easy it can be done in a few automated steps. In this post I will demonstrate how to get step debugging functioning with PhpStorm and Zend Debugger when the server is set up on a local environment.

    To begin with, I had the following:

    • Local installation of Zend Server 8.5.+ (basic LAMP stack, but with Zend Debugger included in the Zend Server installation). Alternatively I could have had a vanilla LAMP environment with Xdebug.
    • Ensure that Z-Ray is active in the Zend Server settings.
    • A local project set up on PhpStorm, without the server set up in the PhpStorm project configuration. (in this example I have a Zend Expressive Skeleton ready)
    • The local project set up as an Apache virtualhost.

    With the project open in PhpStorm I click the icon to inform the IDE to start listening for debugging sessions. (Usually in the upper right corner, looks like a telephone receiver with a red indicator that it is not listening, and turns green when you click it)

    Then a browser with the application rendered I click the debug icon in the Z-Ray toolbar at the foot of the window, and select the desired debugging action.

    This will cause PhpStorm to prompt after it receives the debug connection from Zend Debugger. In most cases we can simply click Accept and let things happen normally.

    That’s about it, we are debugging!

    Behind the scenes, PhpStorm created a site and associated it with the project.

    Of course we could have created the server ahead of time and not be prompted to Accept the incoming connection, but what is the fun in that?

    Closing

    This was a very simplistic local development environment setup. We didn’t have a firewall to contend with, and the server was set up locally rather than inside a virtual machine. I have other posts, linked below, to help with some of these alternative setups.

    Happy Debugging!

    Other posts on Debugging you may find helpful: