這篇文章主要介紹了如何處理PHP開發版本的問題,具有一定借鑒價值,需要的朋友可以參考下。希望大家閱讀完這篇文章后大有收獲。下面讓小編帶著大家一起了解一下。
在安裝一個開源項目時,作者本地用了 PHP 7.1 進行開發,而我本地是 PHP 7.0, 于是悲劇發生了,出現了這樣的錯誤:requires php ^7.1 -> your PHP version (7.0.13) does not satisfy that requirement.
.
composer install 之后報錯
vagrant@homestead:~/Code/sample$ composer install Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Your requirements could not be resolved to an installable set of packages. Problem 1 - Installation request for doctrine/instantiator 1.1.0 -> satisfiable by doctrine/instantiator[1.1.0]. - doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.13) does not satisfy that requirement. Problem 2 - doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.13) does not satisfy that requirement. - phpunit/phpunit-mock-objects 2.3.8 requires doctrine/instantiator ^1.0.2 -> satisfiable by doctrine/instantiator[1.1.0]. - Installation request for phpunit/phpunit-mock-objects 2.3.8 -> satisfiable by phpunit/phpunit-mock-objects[2.3.8].
刪除 composer.lock
文件,重新執行 composer install
,這樣就能重新生成 composer.lock
文件了。
composer 包自動加載后,會生成一個 composer.lock
鎖文件,所以,在從GitHub拉取別人的代碼后,需要對這個文件進行刪除。
感謝你能夠認真閱讀完這篇文章,希望小編分享如何處理PHP開發版本的問題內容對大家有幫助,同時也希望大家多多支持億速云,關注億速云行業資訊頻道,遇到問題就找億速云,詳細的解決方法等著你來學習!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。