解决ubuntu上lumen/laravel框架composer出现的问题

环境:Ubuntu16.04 + php7.2

通常一个项目移植到ubuntu服务器上后,有时会进行composer重新安装各种依赖包,这时经常会报错,而composer失败,以下是我遇到过的问题和解决方法

  1. 如果laravel new my_app 创建新项目失败报错

[RuntimeException]
The Zip PHP extension is not installed. Please install it and try again.

解决办法安装sudo apt-get install php7.2-zip

  1. laravel/framework v5.2.18 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system。

解决办法执行sudo apt-get install php7.2-mbstring 不需要更改 php.ini 文件。

3.phpunit/phpunit 4.0.2 requires ext-dom * -> the requested PHP extension dom is missing from your system. 解决办法执行sudo apt-get install php-xml

4.PDOException: could not find driver 解决办法执行sudo apt-get -y install php-mysql

总结就是大多错误是php扩展没安装。

%1 $ S

发表评论

电子邮件地址不会被公开。 必填项已用*标注