Strange behaviour when trying to release new code composer autoloader

49 views Asked by At

When recently deploying a PHP application we've had errors such as "Call to undefined method......" when after checking on ftp that the method is clearly in the file.

The strange part about it, is that if we edit the composer autoload files: vendor/autoload.php and vendor/composer/autoload_static.php files, literally putting a space or newline somewhere in the file. Then all of a sudden the methods resolve properly.

Anyone have any idea what's going on?

Using Apache2.4 on ubuntu 16 with php-fpm to php 5.6.31.

Also if it helps, we have the same codebase on the server on 4 different vhosts.

Have tried:

Running composer dump-autoload

Running composer update

Running opcache_reset() from a web page

The even funnier thing is, when we remove the newlines from the two autoload files, it breaks again. It's as if the autoload files have been cached somewhere and are identified by their hash or something.

0

There are 0 answers