2016-10-25 35 views
0

我在一臺新的開發機器上,我遇到安裝Laravel,Spark或任何需要比PHP 5.5.30更新的東西的問題。由於系統PHP版本安裝Laravel/Spark問題

問題是,我正在使用運行PHP 7.0.1的MAMP Pro。我也嘗試使用本教程來更新我的系統的PHP版本PHP 7:https://coolestguidesontheplanet.com/upgrade-php-on-osx/

☁ /webroot spark new app 
Crafting application... 
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 
- This package requires php >=5.6.4 but your PHP version (5.5.30) does not satisfy that requirement. 
Problem 2 
    - Installation request for laravel/framework v5.3.20 -> satisfiable by laravel/framework[v5.3.20]. 
    - laravel/framework v5.3.20 requires php >=5.6.4 -> your PHP version (5.5.30) does not satisfy that requirement. 
Problem 3 
    - Installation request for phpunit/php-code-coverage 4.0.1 -> satisfiable by phpunit/php-code-coverage[4.0.1]. 
    - phpunit/php-code-coverage 4.0.1 requires php ^5.6 || ^7.0 -> your PHP version (5.5.30) does not satisfy that requirement. 
Problem 4 
    - Installation request for phpunit/phpunit 5.6.2 -> satisfiable by phpunit/phpunit[5.6.2]. 
- phpunit/phpunit 5.6.2 requires php ^5.6 || ^7.0 -> your PHP version (5.5.30) does not satisfy that requirement. 
Problem 5 
    - Installation request for phpunit/phpunit-mock-objects 3.4.0 -> satisfiable by phpunit/phpunit-mock-objects[3.4.0]. 
    - phpunit/phpunit-mock-objects 3.4.0 requires php ^5.6 || ^7.0 -> your PHP version (5.5.30) does not satisfy that requirement. 
Problem 6 
    - Installation request for sebastian/code-unit-reverse-lookup 1.0.0 -> satisfiable by sebastian/code-unit-reverse-lookup[1.0.0]. 
- sebastian/code-unit-reverse-lookup 1.0.0 requires php >=5.6 -> your PHP version (5.5.30) does not satisfy that requirement. 
Problem 7 
    - Installation request for sebastian/object-enumerator 1.0.0 -> satisfiable by sebastian/object-enumerator[1.0.0]. 
- sebastian/object-enumerator 1.0.0 requires php >=5.6 -> your PHP version (5.5.30) does not satisfy that requirement. 
Problem 8 
    - Installation request for sebastian/resource-operations 1.0.0 -> satisfiable by sebastian/resource-operations[1.0.0]. 
- sebastian/resource-operations 1.0.0 requires php >=5.6.0 -> your PHP version (5.5.30) does not satisfy that requirement. 
Problem 9 
    - Installation request for sebastian/version 2.0.0 -> satisfiable by sebastian/version[2.0.0]. 
    - sebastian/version 2.0.0 requires php >=5.6 -> your PHP version (5.5.30) does not satisfy that requirement. 

Application ready! Build something amazing. 
Downloading Spark... 

我不想只是由作曲家文件編輯跳過所需的PHP版本,因爲我不是確定它是否在安裝應用程序時導致問題。我的Spark或Laravel的安裝都沒有工作,他們只是給出了一個500狀態錯誤,可能是別的,但我認爲這是同樣的問題。

+1

你的PHP CLI版本似乎是30年5月5日 - 如果你正在使用不同的應用程序/框架/版本一起工作,我強烈建議你看看虛擬化/集裝箱化的開發設置。它可以讓你啓動一個或多個環境,併爲每個應用程序提供所需的任何庫和版本。 https://box.scotch.io/ https://laravel.com/docs/master/homestead – JimL

+0

你需要更新你的PATH,所以你的「終端」與super-duper一起工作(是的,我很諷刺)MAMP PRO 。我不喜歡虛擬化,並且在本地環境上開發(如果小項目+我只是在項目上開發),但是臨時服務器肯定在使用 - >生產。 – Kyslik

+0

@JimL給家園一個嘗試。永遠安裝Vagrant,但希望這能解決我的問題。如果確實如此,我會通知你。謝謝! –

回答

0

全部固定。 感謝@Kyslik的建議。

我以前曾嘗試更新我的PATH,但由於某種原因,它這次工作。我以前一定犯過錯誤。對於任何人有這個問題的參考,我也跟着這樣的:

How to override the path of PHP to use the MAMP path?

+0

拋開MAMP,學習你的系統是如何工作的(至少像設置開發環境這樣的基礎知識),稍後再感謝我。 – Kyslik