I am trying to install Zend via a composer command in Linux. I am following the official Zend tutorial. And I am able to make a simple application, which is working perfectly. However, when I follow this tutorial's advice to use composer development-enabl e. But an CommandNotFound Exception is appearing if I am using composer dev...-enable and executing the full command:-

Command "development-enable" is not defined.

I am looking forward to someone, who has successfully able to fix this issue?

I am thinking, this is a common issue with $PATH value. At the same time, I am implementing composer command without any issues. Then, there are more chances of some issues with subcommand. Something likes missing important dependency.
The tutorial, I am following is this one: docs.zendframeworkdotcom/tutorials/getting-started/skeleton-application/
I am using Command Line Interface, with version 5.4.43. Also, I can't update this version. As I have Apache server 5.6 on my machine and also, I am using bash shell.

Failed solutions tried in the past:

Solution 1
On trying to rerun my installation with composer create-project (as you can see in the above tutorial) is not improving the solution.
Solution 2
I have already tried 'composer "development-enable"' without any success. I have implemented composer.json with development enabled and also I am running the composer in CLI on the root.
Solution 3
Someone suggested about issues in installation, so I have reinstalled the framework. After reinstalling, this thing keeps on appearing.
Also, I am having another issue, which is disturbing the design of my whole website. I am trying to use an API in jquery and implement maps on top and middle of the article (This map is the zoomed in version of the map at the top). I am able to successfully load the map at the top. But, on trying to load map at middle of the article, I am getting roman subscript and with loading is slowed. Example: my clients’ website contains directories like http://militarybases.co/directory/dugway-proving-ground-army-base-in-tooele-county-ut/. I will be showing the Dugway proving ground army base maximized version? In the above example, I have removed the map from the middle. But it is coming with issues. So there are 2 issues, 1-random roman script and 2-slow loading.

Can, anyone suggest any solution for this too?

Dani AI

Generated

Two separate problems are being reported in this thread: the Composer subcommand error and the second (middle-of-article) map rendering/slow-loading issue. This note is aimed at clarifying both problems and giving practical, testable fixes that match the discussion by and the follow-up from .

For the Composer "development-enable" error

  • Cause summary: that subcommand is provided by the zf-development-mode package and Composer will only expose it when the package is present and compatible with the PHP version in use (see ). Upgrading PHP solved the problem for .

  • Practical options:

    • Best: upgrade to a maintained PHP release and then install the current zf-development-mode so composer development-enable works.
    • If upgrading is impossible, require an older branch of the tool that matches your PHP and enable it as a dev dependency. Example commands (run in the project root):
    composer require --dev zfcampus/zf-development-mode:"^2.0"
    composer development-enable
    • Useful diagnostics:
    composer show zfcampus/zf-development-mode
    composer show --installed
    composer diagnose
    • If the command still does not appear, confirm the package is in require-dev of composer.json, run composer dump-autoload, and inspect vendor/ for the package scripts. When changing PHP on a server, test on staging and back up configs first.

For the map that renders oddly in the article and slows the page

  • Common causes: loading the Maps JS twice, using duplicate DOM ids, initializing a map while its container is hidden, or initializing many markers synchronously.

  • Quick checks: open the browser console (look for duplicate-API or InvalidValueError messages) and the Network panel to see which resource is slow.

  • Fixes to try:

    • Ensure only one Maps JS <script> is included.
    • Give each map a unique id and set explicit CSS height for each map container.
    • If the mid-article map is initially hidden, initialize it when visible or call:
    google.maps.event.trigger(mapMid, 'resize');
    mapMid.setCenter({lat: YOUR_LAT, lng: YOUR_LNG});
    • Improve performance by lazy-loading the mid-article map (IntersectionObserver) or by showing a static image until the user scrolls to or clicks the map. Example lazy-init pattern:
    var obs = new IntersectionObserver(function(entries) {
      if (entries[0].isIntersecting) { initMidMap(); obs.disconnect(); }
    });
    obs.observe(document.getElementById('mapMid'));

Summary

  • For the Composer error, either match zf-development-mode to your PHP (older branch) or upgrade PHP (the most robust solution, as found). For the map, check for duplicate API loads, unique IDs, explicit container heights, JS console errors, and use deferred/lazy initialization to eliminate rendering glitches and slow loading.

Recommended Answers

All 2 Replies

Hi,

the composer command development-enable is part of the zf-development-mode tools which ships in version 3.0 and requires PHP 5.6 or PHP 7.0, you're using 5.4, so it won't be installed. See if you can install version 2.* of these tools, as it should support your PHP version. For more information see:

Was stuck on the same problem as well for a day and found that upgrading from php 5.5.9 to 5.6 fixed the issue. Thanks :)

commented: you're welcome! +14
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.