环境:Ubuntu16.04 + php7.2
通常一个项目移植到ubuntu服务器上后,有时会进行composer重新安装各种依赖包,这时经常会报错,而composer失败,以下是我遇到过的问题和解决方法
-
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
-
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 解决办法执行
总结就是大多错误是php扩展没安装。