My composer won't update completely with Laravel 4 it gets stuck with artisan

Stefan Bogdanescu

Founder & Senior Architect · 2026-06-29

Laravel Company

Unstuck in the Past: Troubleshooting Composer Failures in Legacy Laravel 4 Projects

As senior developers, we all know the frustration of hitting a wall during dependency management. When dealing with legacy projects, especially those built on older frameworks like Laravel 4, these issues often stem from a complex interplay between outdated dependencies, PHP version incompatibilities, and broken autoloader files.

The error logs you provided paint a very specific picture: Composer is stalling while trying to run an Artisan command (optimize), leading to runtime exceptions related to missing classes (Patchwork\Utf8\Bootup, Class config does not exist). This isn't just a simple dependency failure; it’s a symptom of deep structural corruption within the application's bootstrapping process.

This post will walk you through the diagnostic steps and solutions to resolve these stubborn Composer update failures in environments like Laravel 4, ensuring your project remains stable.

Diagnosing the Composer Stalemate

The initial hang during composer update followed by a generic RuntimeException suggests that Composer is attempting to execute scripts (like those generated by post-update events) which rely on classes that are either missing or improperly loaded in the current environment.

When you see errors like Class 'Patchwork\Utf8\Bootup' not found, it immediately points to a broken autoloader or an incomplete installation of a required package. In older Laravel setups, dependency resolution often interacts poorly with filesystem operations and autoloading mechanisms if the environment (PHP version, Composer version) is slightly off.

Why Deleting vendor Didn't Work

Deleting the vendor folder only removes the installed dependencies; it doesn't fix the internal configuration or bootstrap files that were potentially corrupted during the failed update attempt. The core issue lies in the compiled framework files themselves.

Fixing Autoloading and Framework Instability

The subsequent fatal errors, such as 'Class config does not exist', confirm that the application's bootstrapping mechanism—specifically how Laravel loads its configuration and service containers—has been broken. This usually happens when Composer updates dependencies but fails to correctly regenerate or link the necessary class maps.

Here is a pragmatic sequence of steps to resolve this:

Step 1: Clean the Environment Thoroughly

Before attempting any further updates, ensure you start with a completely clean slate for your project dependencies.

  1. Delete vendor and composer.lock: Manually remove the entire vendor directory and the composer.lock file from your project root to eliminate corrupted state.
  2. Clear Composer Cache: Force Composer to clear any cached data that might be interfering with the update process:
    composer clear-cache
    

Step 2: Verify PHP Compatibility

Since you are working with an older setup (Laravel 4, PHP 5.4.10), ensure your environment is stable. While Composer itself is robust, compatibility issues often surface when dealing with older library versions. Ensure that the environment executing the command is consistent and free of conflicting modules.

Step 3: Re-run the Update with Verbosity

Attempt the update again, using verbose flags to capture any subtle errors that might be missed during a silent execution:

sudo composer update --verbose

If this still fails in the same manner, proceed to the next step.

Step 4: Address Core Framework Files (Advanced)

If the issue persists, it often requires manually inspecting or re-generating framework files that Composer failed to handle correctly. In legacy projects, sometimes forcing a full rebuild of the autoloader is necessary. For modern applications, frameworks like those promoted by Laravel Company rely on highly integrated dependency management; these older setups require more manual intervention.

If you suspect the core framework files are damaged, consider manually reviewing the bootstrap/ directory after a clean install to ensure essential files are present before trying to trigger any further Artisan commands.

Conclusion: The Developer Mindset for Legacy Code

Troubleshooting legacy code is less about executing a single command and more about understanding the history of the dependencies. When Composer fails in this manner, it signals that the dependency graph has been broken, not just that a package is missing.

The key takeaway is to adopt a defensive strategy: always start with a pristine environment (clearing caches and directories) before attempting updates. For projects rooted in older architectures, pairing automated tooling like Composer with rigorous manual environmental checks ensures that even stubborn legacy code can be brought back into order. By treating the environment as critical infrastructure, you can successfully navigate these complex dependency hurdles.