Errors installing Laminas MVC Skeleton

If you’re trying to start the basic Laminas skeleton application and the very first step of installation is failing, it would be fair to assume the project is going to be a mess moving forward. The good news is that moving past the PHP critical error is pretty easy.

PHP 7.4x, Composer 2.

The problem is during the initial step of installing the MVC Laminas framework using Composer 2 with PHP 7.4+.

composer create-project -s dev laminas/laminas-mvc-skeleton path/to/install

Generates the following error, which then produces a stack trace implicating OptionalPackagesInstaller.php as the culprit.:

PHP Fatal error: Uncaught TypeError: Argument 1 passed to Symfony\Component\Console\Question\Question::__construct() must be of the type string, array given, called in /usr/share/php/Composer/IO/ConsoleIO.php on line 273 and defined in /usr/share/php/Symfony/Component/Console/Question/Question.php:38

Fear not! The fix is surprisingly easy. You’ll be editing the following file in your project folder:

vendor/laminas/laminas-skeleton-installer/src/OptionalPackagesInstaller.php and correcting one mistake, the passing of an array instead of a string, in 2 different places:

  1. OptionalPackagesInstaller.php, Line 138: remove the opening bracket following the ‘=’ when setting the $question variable. Then, remove the closing bracket and the comma (around line 143).
  2. Same file, same concept: remove the brackets and unnecessary comma from the $question variable set in line 169.

Re-run composer install after saving the corrected file. It should now prompt you for the installation options.

If it throws any issues regarding the installation of PHP modules, review how you installed PHP initially and address each issue accordingly.

When WordPress Sitemap Generators Fail

Improving organic Google search results for your business’ WordPress-based website depends on ensuring that Google knows about every page, every post, every media item. To inform Google of your site’s content, we use “site maps” which are files that contain links to every aspect of your website. These sitemaps are submitted to Google so that it knows where to send its web “robots”.

Generating sitemap files can be quite involved if you attempt to do it manually, particularly if you have a lot of content on your site, such as products or a long history of posts. They are generally created in XML format, which

To overcome the challenge of manually creating sitemap files, plugins are available that will generate them for you. This can be an incredible time saver, though they are not without their own risks.

Installing a sitemap generator is no different than most WordPress plugins. Identify the one you wish to use, install it. Answer a few questions in the provided settings interface, such as whether to include or exclude static pages, posts, media, etc. You should also have the option of indicating how frequently your pages & posts are updated (hourly, daily, weekly, monthly, yearly).

Submitting the index file to Google is also quite straightforward providing you’re familiar with validating your website with the Google Webmasters service. You may need to place a simple text file on your website or add a small entry to your DNS records to prove to Google that you are an authorized agent of the website.

Once your sitemap has been submitted to Google Webmasters, Google will test the links and crawl your site over time with its Googlebot spider service. Googlebot will capture your website content and determine how useful it will be to the general Internet population in their searches. The more relevant your content is, the higher up in the organic search results your site will appear.

When all of the moving parts are functioning perfectly, it can be great for your search results and your business. But how do you know that everything is working correctly?

Google Webmasters will inform you of issues with your site. It will indicate errors with how it crawled your content and provide some relatively cryptic explanation of what needs to be repaired. It will show you what pages it has indexed, how frequently it returns to detect changes and any recommendations for improvement.

Listen to Google Webmasters, particularly in regards to sitemaps. This morning we received an email from one of our valued past customers who received notice from Google:

“Hey guys… I just got an email from Google saying that a new issue was found, ‘Submitted URL marked noindex.’  I promise we haven’t changed anything, just staying on top of our updates like you said we should.”

Therein lies the problem: something changed not in the site’s content, but likely within the plugin that was managing their sitemaps. While installing updates on a regular basis is a good practice, they are still at risk of programming bugs, conflicts and unintended consequences of changes.

While digging through the Webmaster results and testing the sitemaps, we discovered that a recent update to the plugin added ‘noindex’ to the site’s dynamically generated robots.txt file by default! Gasp! This is essentially telling Google, “Here are all of my links….just go ahead and ignore them.”

It appeared that many users of the plugin were encountering the same issue. This is a widely used plugin, too. We also discovered that deeper links were now incorrectly formatted in XML and were considered invalid by the hundreds.

Quick response to remove the offending plugin, identify and test a few replacement options and resubmitting the rebuilt index file should repair any damage. But it required prompt action and a deep familiarity with how search engines work to mitigate any damage.

Lesson: stay on top of your updates and review every message from Google Webmasters the moment it arrives. Search for a fix, but if you tread into unfamiliar territory, don’t hesitate to contact your site administrator… or us. We’re happy to help.


Passbolt Installation and Hosting

Passbolt is a free and open-source secure password manager for your team. It allows you to assign managers to groups, and individuals to groups who should – or should not – have access to a variety of account logins.

If your current password management tool is a spreadsheet sitting on someone’s computer or – worse – taped to your wall, you need Passbolt in your company.

Stop scrambling to update all of your accounts after an employee has quit or is terminated. Limit what they know and when they can know it, then protect those assets with mitigated risk!

Passbolt Secure Password Manager

Installation can be a little tricky at times, particularly if you’re hosting on cloud/shared servers.

We can help with installation, hosting, configuring and implementing Passbolt within your company.