只需要一种选项:使用IntelliJ快速搭建CakePHP环境

【参考】
通过IntelliJ快速搭建PHP开发环境。

在上述的文章中提到,PHP的环境基本上是可行的。

当我试图升级Mac默认的PHP版本时,遇到了一点麻烦…

我被PHP版本升级的问题困扰住了。

如果只是一直敲打这个的话,我觉得就可以了。

brew update
brew install php56

哇哦

Error: No available formula with the name "php56" 
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
These formulae were found in taps:
homebrew/php/php56-amqp            homebrew/php/php56-ioncubeloader   homebrew/php/php56-pdo-dblib       homebrew/php/php56-swoole        
homebrew/php/php56-apcu            homebrew/php/php56-jsmin           homebrew/php/php56-pdo-pgsql       homebrew/php/php56-symfony-debug 
homebrew/php/php56-augmentedtypes  homebrew/php/php56-judy            homebrew/php/php56-phalcon         homebrew/php/php56-thrift        
homebrew/php/php56-binpack         homebrew/php/php56-kafka           homebrew/php/php56-pimple          homebrew/php/php56-tidy          
homebrew/php/php56-blitz           homebrew/php/php56-leveldb         homebrew/php/php56-pinba           homebrew/php/php56-timecop       
homebrew/php/php56-boxwood         homebrew/php/php56-libevent        homebrew/php/php56-proctitle       homebrew/php/php56-timezonedb    
homebrew/php/php56-chdb            homebrew/php/php56-libsodium       homebrew/php/php56-propro          homebrew/php/php56-twig          
homebrew/php/php56-couchbase       homebrew/php/php56-libvirt         homebrew/php/php56-protobuf        homebrew/php/php56-uopz          
homebrew/php/php56-crypto          homebrew/php/php56-lz4             homebrew/php/php56-pspell          homebrew/php/php56-uploadprogress
homebrew/php/php56-dbase           homebrew/php/php56-lzf             homebrew/php/php56-pthreads        homebrew/php/php56-uuid          
homebrew/php/php56-dbus            homebrew/php/php56-magickwand      homebrew/php/php56-qr              homebrew/php/php56-v8js          
homebrew/php/php56-dmtx            homebrew/php/php56-mailparse       homebrew/php/php56-raphf           homebrew/php/php56-varnish       
homebrew/php/php56-eio             homebrew/php/php56-maxminddb       homebrew/php/php56-rdkafka         homebrew/php/php56-vld           
homebrew/php/php56-ev              homebrew/php/php56-mcrypt          homebrew/php/php56-redis           homebrew/php/php56-wbxml         
homebrew/php/php56-event           homebrew/php/php56-mecab           homebrew/php/php56-redland         homebrew/php/php56-xcache        
homebrew/php/php56-fast_assert     homebrew/php/php56-memcache        homebrew/php/php56-riak            homebrew/php/php56-xdebug        
homebrew/php/php56-gearman         homebrew/php/php56-memcached       homebrew/php/php56-runkit          homebrew/php/php56-xhgui         
homebrew/php/php56-geoip           homebrew/php/php56-meminfo         homebrew/php/php56-scrypt          homebrew/php/php56-xhprof        
homebrew/php/php56-gmagick         homebrew/php/php56-midgard2        homebrew/php/php56-snappy          homebrew/php/php56-xmldiff       
homebrew/php/php56-gmp             homebrew/php/php56-mongo           homebrew/php/php56-snmp            homebrew/php/php56-xxtea         
homebrew/php/php56-gnupg           homebrew/php/php56-mongodb         homebrew/php/php56-sodium          homebrew/php/php56-yac           
homebrew/php/php56-graphdat        homebrew/php/php56-mosquitto       homebrew/php/php56-solr            homebrew/php/php56-yaf           
homebrew/php/php56-grpc            homebrew/php/php56-msgpack         homebrew/php/php56-sphinx          homebrew/php/php56-yaml          
homebrew/php/php56-hprose          homebrew/php/php56-mustache        homebrew/php/php56-spl-types       homebrew/php/php56-yar           
homebrew/php/php56-htscanner       homebrew/php/php56-mysqlnd_ms      homebrew/php/php56-ssh2            homebrew/php/php56-yaz           
homebrew/php/php56-http            homebrew/php/php56-oauth           homebrew/php/php56-stats           homebrew/php/php56-yp            
homebrew/php/php56-httpparser      homebrew/php/php56-opcache         homebrew/php/php56-stemmer         homebrew/php/php56-yrmcds        
homebrew/php/php56-igbinary        homebrew/php/php56-parsekit        homebrew/php/php56-suhosin         homebrew/php/php56-zmq           
homebrew/php/php56-imagick         homebrew/php/php56-pcntl           homebrew/php/php56-sundown         homebrew/php/php56-zookeeper     
homebrew/php/php56-intl            homebrew/php/php56-pdflib          homebrew/php/php56-svm             homebrew/php/php56               
To install one of them, run (for example):
  brew install homebrew/php/php56-amqp

我試著進行調查,結果果然找到了。
我嘗試用Homebrew在Mac上安裝了PHP5.6環境。

好像需要创建一个存储库。

brew tap homebrew/php
brew tap homebrew/dupes

重新开始…

brew install php56
php -v

请确保将其更改为5.6。

PHP 5.6.23 (cli) (built: Jun 24 2016 21:14:33) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
Kobito.YxvZFe.png

我要放蛋糕进去。

【参考】
OS X で PhpStorm で Composer 使って CakePHP 2.5 入れてあとテスト
Composerを利用したCakePHP2.4.xの導入手順

プロジェクト作ったらついにCakeを入れる。
PHPのパッケージ管理ツールであるcomposerを入れて使ってみる。

brew install composer

作成したプロジェクト直下にcomposer.jsonを作成して必要なモジュール(と呼ぶのか?)を定義してインストール。

{
  "name": "hello-cake",
  "repositories": [
    {
      "type": "pear",
      "url": "http://pear.cakephp.org"
    }
  ],
  "require": {
    "cakephp/cakephp": "3.2.9"
  },
  "require-dev": {
    "phpunit/phpunit": "5.4.*",
    "cakephp/debug_kit": "3.2.9"
  },
  "config": {
    "vendor-dir": "Vendor/"
  }
}
php composer.phar install

嘿嘿

Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package pear-cakephp/cakephp could not be found in any version, there may be a typo in the package name.
  Problem 2
    - cakephp/debug_kit 3.2.0 requires cakephp/cakephp 3.1.* -> satisfiable by cakephp/cakephp[3.1.0, 3.1.1, 3.1.10, 3.1.11, 3.1.12, 3.1.13, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.8, 3.1.9].
    - cakephp/debug_kit 3.2.1 requires cakephp/cakephp 3.1.* -> satisfiable by cakephp/cakephp[3.1.0, 3.1.1, 3.1.10, 3.1.11, 3.1.12, 3.1.13, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.8, 3.1.9].
    - cakephp/debug_kit 3.2.2 requires cakephp/cakephp 3.1.* -> satisfiable by cakephp/cakephp[3.1.0, 3.1.1, 3.1.10, 3.1.11, 3.1.12, 3.1.13, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.8, 3.1.9].
    - cakephp/debug_kit 3.2.3 requires cakephp/cakephp >=3.1.0 -> satisfiable by cakephp/cakephp[3.1.0, 3.1.1, 3.1.10, 3.1.11, 3.1.12, 3.1.13, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.8, 3.1.9, 3.2.0, 3.2.1, 3.2.10, 3.2.11, 3.2.12, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.2.8, 3.2.9].
    - cakephp/debug_kit 3.2.4 requires cakephp/cakephp >=3.1.0 <4.0 -> satisfiable by cakephp/cakephp[3.1.0, 3.1.1, 3.1.10, 3.1.11, 3.1.12, 3.1.13, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.8, 3.1.9, 3.2.0, 3.2.1, 3.2.10, 3.2.11, 3.2.12, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.2.8, 3.2.9].
    - cakephp/debug_kit 3.2.5 requires cakephp/cakephp >=3.1.0 <4.0 -> satisfiable by cakephp/cakephp[3.1.0, 3.1.1, 3.1.10, 3.1.11, 3.1.12, 3.1.13, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.8, 3.1.9, 3.2.0, 3.2.1, 3.2.10, 3.2.11, 3.2.12, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.2.8, 3.2.9].
    - cakephp/debug_kit 3.2.6 requires cakephp/cakephp >=3.1.0 <4.0 -> satisfiable by cakephp/cakephp[3.1.0, 3.1.1, 3.1.10, 3.1.11, 3.1.12, 3.1.13, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.8, 3.1.9, 3.2.0, 3.2.1, 3.2.10, 3.2.11, 3.2.12, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.2.8, 3.2.9].
    - cakephp/debug_kit 3.2.7 requires cakephp/cakephp >=3.1.0 <4.0 -> satisfiable by cakephp/cakephp[3.1.0, 3.1.1, 3.1.10, 3.1.11, 3.1.12, 3.1.13, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.8, 3.1.9, 3.2.0, 3.2.1, 3.2.10, 3.2.11, 3.2.12, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.2.8, 3.2.9].
    - cakephp/debug_kit 3.2.8 requires cakephp/cakephp >=3.1.0 <4.0 -> satisfiable by cakephp/cakephp[3.1.0, 3.1.1, 3.1.10, 3.1.11, 3.1.12, 3.1.13, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.8, 3.1.9, 3.2.0, 3.2.1, 3.2.10, 3.2.11, 3.2.12, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.2.8, 3.2.9].
    - cakephp/debug_kit 3.2.9 requires cakephp/cakephp >=3.1.0 <4.0 -> satisfiable by cakephp/cakephp[3.1.0, 3.1.1, 3.1.10, 3.1.11, 3.1.12, 3.1.13, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.8, 3.1.9, 3.2.0, 3.2.1, 3.2.10, 3.2.11, 3.2.12, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.2.8, 3.2.9].
    - cakephp/cakephp 3.2.9 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.2.8 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.2.7 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.2.6 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.2.5 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.2.4 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.2.3 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.2.2 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.2.12 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.2.11 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.2.10 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.2.1 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.2.0 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.1.9 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.1.8 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.1.7 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.1.6 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.1.5 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.1.4 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.1.3 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.1.2 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.1.13 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.1.12 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.1.11 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.1.10 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.1.1 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/cakephp 3.1.0 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - Installation request for cakephp/debug_kit 3.2.* -> satisfiable by cakephp/debug_kit[3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.2.8, 3.2.9].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
  To enable extensions, verify that they are enabled in those .ini files:
    - /usr/local/etc/php/5.6/php.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

可能性共保该报错信息显示你的系统中缺少所需的PHP扩展intl。似乎需要安装名为php-intl的扩展,因此请安装它并重新启动系统。这一次一定要成功。

brew install php56-intl
composer install

来了。

undefined

创建蛋糕项目!!!!

php composer.phar create-project --prefer-dist -s dev cakephp/app hello-cake

在使用蛋糕服务器上启动了测试页面。

hello-cake/bin/cake server
Kobito.Ykyzr3.png
广告
将在 10 秒后关闭
bannerAds