之前一直使用 flarum 做我的博客系统,php好多年没用了本人已经忘记了,出现了一些问题,解决起来非常麻烦,通过查找资料还是解决了问题,记录给遇见相同问题的人吧。
PHP Warning: Phar::mapPhar(): open_basedir restriction in effect
PHP Warning: Phar::mapPhar(): open_basedir restriction in effect. File(/usr/local/bin/composer) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/) in /usr/local/bin/composer on line 13
PHP Warning: require(phar://composer.phar/bin/composer): failed to open stream: phar error: invalid url or non-existent phar "phar://composer.phar/bin/composer" in /usr/local/bin/composer on line 15
PHP Fatal error: require(): Failed opening required 'phar://composer.phar/bin/composer' (include_path='.:/usr/share/pear') in /usr/local/bin/composer on line 15
删除.user.ini文件或者修改 php的配置文件my.ini里的open_basedir=(应用程序目录)或者修改 nginx 的的配置文件fastcgi.conf里的fastcgi_param PHP_ADMIN_VALUE "open_basedir=(应用程序目录):/tmp/:/proc/";
PHP Fatal error: Class UpdateHelper\ComposerPlugin contains 2
PHP Fatal error: Class UpdateHelper\ComposerPlugin contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Composer\Plugin\PluginInterface::deactivate, Composer\Plugin\PluginInterface::uninstall) in /mnt/www/wwwroot/flarum/vendor/kylekatarnls/update-helper/src/UpdateHelper/ComposerPlugin.php on line 11
Fatal error: Class UpdateHelper\ComposerPlugin contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Composer\Plugin\PluginInterface::deactivate, Composer\Plugin\PluginInterface::uninstall) in /mnt/www/wwwroot/flarum/vendor/kylekatarnls/update-helper/src/UpdateHelper/ComposerPlugin.php on line 11
[root@localhost flarum]# composer -v
PHP Fatal error: Class UpdateHelper\ComposerPlugin contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Composer\Plugin\PluginInterface::deactivate, Composer\Plugin\PluginInterface::uninstall) in /mnt/www/wwwroot/flarum/vendor/kylekatarnls/update-helper/src/UpdateHelper/ComposerPlugin.php on line 11
Fatal error: Class UpdateHelper\ComposerPlugin contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Composer\Plugin\PluginInterface::deactivate, Composer\Plugin\PluginInterface::uninstall) in /mnt/www/wwwroot/flarum/vendor/kylekatarnls/update-helper/src/UpdateHelper/ComposerPlugin.php on line 11
进入你的项目 /vendor/