laravelÔÚmacÉÏÃæ×°ÖÃ
laravelÊÇÒ»¸öÓÅÒìµÄphp¿ò¼Ü£¬ÆÕ±éÓ¦ÓÃÓÚweb¿ª·¢ÖС£ÔÚmacÉÏ×°ÖÃlaravelÐèҪһЩ»ù´¡µÄÏÂÁîÐй¤¾ß£¬ÒÔ¼°phpºÍcomposerµÈÈí¼þµÄÖ§³Ö¡£±¾ÎĽ«Ïòµ¼¸÷ÈËÒ»²½²½Íê³ÉlaravelÔÚmacÉϵÄ×°Öá£
×°ÖÃHomebrew
Ê×ÏÈ£¬ÎÒÃÇÐèҪװÖÃÒ»¸öMac°ü¹ÜÀíÆ÷¡ª¡ªHomebrew£¬Ëü¿ÉÒÔÈÃÎÒÃǸüÀû±ãµØ×°ÖúÍÖÎÀíÖÖÖÖÓ¦Óá£
ÔÚÖÕ¶ËÖÐÖ´ÐÐÒÔÏÂÏÂÁî×°ÖÃHomebrew£º
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
µÇ¼ºó¸´ÖÆ
×°ÖÃÍê³Éºó£¬ÎÒÃÇ¿ÉÒÔʹÓÃbrewÏÂÁîÀ´×°ÖÃÖÖÖÖÈí¼þ°ü£¬ºÃ±ÈPHP¡¢ComposerµÈ¡£
×°ÖÃPHPºÍComposer
LaravelÊÇ»ùÓÚPHPÔËÐеģ¬ÒÔÊÇÎÒÃÇÐèÒªÔÚMacÉÏ×°ÖÃPHPºÍComposer¡£ÔÚÖÕ¶ËÖÐÖ´ÐÐÒÔÏÂÏÂÁî×°Öãº
brew install php
µÇ¼ºó¸´ÖÆ
brew install composer
µÇ¼ºó¸´ÖÆ
×°ÖÃÍê³Éºó£¬ÎÒÃÇ¿ÉÒÔʹÓÃphp -vºÍcomposer -vÏÂÁîÀ´ÑéÖ¤ÊÇ·ñ×°ÖÃÀֳɡ£
×°ÖÃLaravel
ÔÚ×°ÖÃLaravel֮ǰ£¬ÎÒÃÇ»¹ÐèҪװÖÃһЩÀ©Õ¹°üºÍÏÂÁîÐй¤¾ß¡£
×°ÖÃÀ©Õ¹°ü
brew install imagemagick
µÇ¼ºó¸´ÖÆ
brew install php-intl
µÇ¼ºó¸´ÖÆ
×°ÖÃÏÂÁîÐй¤¾ß
composer global require laravel/installer
µÇ¼ºó¸´ÖÆ
×°ÖÃÍê³Éºó£¬ÎÒÃÇ¿ÉÒÔʹÓÃlaravelÏÂÁîÀ´½¨ÉèºÍÖÎÀíLaravelÏîÄ¿¡£
½¨ÉèLaravelÏîÄ¿
Ö´ÐÐÒÔÏÂÏÂÁîÀ´½¨ÉèÒ»¸öеÄLaravelÏîÄ¿£º
laravel new myproject
µÇ¼ºó¸´ÖÆ
Õâ»áÔÚÄ¿½ñĿ¼Ï½¨ÉèÒ»¸öÃûΪmyprojectµÄÐÂÏîÄ¿¡£ÔÚÖ´ÐдËÏÂÁîʱ£¬»á×Ô¶¯ÏÂÔØLaravelµÄ½¹µã´úÂëºÍÒÀÀµ°ü£¬²¢ÎªÎÒÃǽ¨ÉèºÃһЩĬÈϵÄÎļþºÍĿ¼½á¹¹¡£
ÔËÐÐLaravelÏîÄ¿
Ö´ÐÐÒÔÏÂÏÂÁîÆô¶¯Laravel¿ª·¢Ð§ÀÍÆ÷£º
cd myproject
µÇ¼ºó¸´ÖÆ
php artisan serve
µÇ¼ºó¸´ÖÆ
ĬÈÏÇéÐÎÏ£¬Laravel»áÔÚhttp://localhost:8000Æô¶¯¿ª·¢Ð§ÀÍÆ÷¡£
ÏÖÔÚÎÒÃÇ¿ÉÒÔÔÚä¯ÀÀÆ÷Öлá¼ûhttp://localhost:8000À´Éó²éLaravelĬÈϵĽӴýÒ³ÃæÁË£¡
×ܽá
ÒÔÉϾÍÊÇÔÚMacÉÏ×°ÖÃLaravelµÄËùÓа취£¬ÐèҪעÖصÄÊÇ£¬×°ÖÃÀú³ÌÖпÉÄÜ»áÓöµ½ÖÖÖÖÒÀÀµºÍÇéÐÎÎÊÌ⣬ÐèҪƾ֤¹ýʧÌáÐѾÙÐе÷½âÏ¢Õù¾ö¡£Ï£ÍûÕâƪÎÄÕÂÄܹ»×ÊÖúµ½ÏëÒªÔÚMacÉÏʹÓÃLaravelµÄ¿ª·¢ÕßÃÇ¡£
ÒÔÉϾÍÊÇlaravelÔÚmacÉÏÃæ×°ÖõÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡