On another machine pull up the latest code, into the background of the Web site, found that the page blank, using PHP artisan cache:clear, PHP artisan clear-compiled and so on to clear the cache and compile the file or not, open the PHP error log to view, found error:
Fatal error:declaration of Illuminate\\auth\\sessionguard::basic () must compatible \\auth\\supportsbasicauth::basic () in/usr/share/nginx/html/tanteng.me/vendor/laravel/framework/src/illuminate/ auth/sessionguard.php on line 17
Find a workable solution on the web to modify the Composer.json file:
Ps://oddyzfr8z.qnssl.com/wp-content/uploads/2016/09/laravel-composer-json-post-install.png "/>
Replace the clear-compiled with the following modifications:
Php
"Post-install-cmd": [
-"PHP artisan clear-compiled",
+ "illuminate\\foundation\\composerscripts::p ostinstall",
"PHP Artisan Optimize"
],
"Post-update-cmd": [
-"PHP artisan clear-compiled",
+ "illuminate\\foundation\\composerscripts::p ostupdate",
"PHP Artisan Optimize"
]
Once the sudo composer update is executed again, the sudo composer Dump-autoload is back to normal.
By the way, let's take a look at both methods, file path laravel/framework/src/illuminate/foundation/composerscripts.php:
Class Composerscripts
{
/**
* Handle the Post-Install Composer event.
*
* @param \composer\script\event $event
* @return void
*/
public static function Postinstall (Event $event)
{
Require_once $event->getcomposer ()->getconfig ()->get (' Vendor-dir '). ' /autoload.php ';
Static::clearcompiled ();
}
/**
* Handle the Post-update Composer event.
*
* @param \composer\script\event $event
* @return void
*/
public static function Postupdate (Event $event)
{
Require_once $event->getcomposer ()->getconfig ()->get (' Vendor-dir '). ' /autoload.php ';
Static::clearcompiled ();
}
/**
* Clear the cached laravel bootstrapping files.
*
* @return void
*/
protected static function clearcompiled ()
{
$laravel = new Application (GETCWD ());
if (file_exists ($compiledPath = $laravel->getcachedcompilepath ())) {
@unlink ($compiledPath);
}
if (file_exists ($servicesPath = $laravel->getcachedservicespath ())) {
@unlink ($servicesPath);
}
}
}
Both of these methods clear the Laravel compilation file, which can be used later to install and update dependent script commands in Composer.json.