LoginSignup
1

More than 3 years have passed since last update.

laravel を利用した、ローカル環境での開発サーバ立ち上げ

Last updated at Posted at 2020-06-09

立ち上げ方について

composer を実行できる環境を想定して、記載します。
自分はmacを利用して、サーバーの立ち上げを行っています。

初めに以下コマンドを実行すると、ServerTestフォルダが作成されます。
composer create-project --prefer-dist laravel/laravel ServerTest

フォルダが作成されたことを確認後、フォルダの直下へ移動。
cd ServerTest

以下コマンドを実行すると http://localhost:8000/ にてサーバーが起動します。
php artisan serve

参考URL

補足

起動したいポートを変更したしい際には、以下のように実行すれば可能。
php artisan serve --port=8080
以下クイックリファレンスにも、その旨の記載があります。
https://readouble.com/laravel/4.2/ja/quick.html

laravelのレポジトリをgit clone して、サーバーを起動しようとしても以下のエラーが発生して、起動しないので、その点はご注意を。
$ php artisan serve

Warning: require(/Users/test/git/php/laravel/vendor/autoload.php): failed to open stream: No such file or directory in /Users/test/git/php/laravel/artisan on line 18

Fatal error: require(): Failed opening required '/Users/test/git/php/laravel/vendor/autoload.php' (include_path='.:') in /Users/test/git/php/laravel/artisan on line 18

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1