与php工匠的空白页为mamp php 5.4.10中的laravel 5服务

I am trying to install Laravel for first time. I installed it on my desktop with the following composer command

composer create-project laravel/laravel laravel-app

The command completed successfully without any error but with some messages like

symfony/var-dumper suggests installing ext-symfony_debug ()
symfony/translation suggests installing symfony/config ()

I now did chmod -R 777 larvel-app to make whole folder writable by everyone. I now started php server with following command

cd laravel-app
php artisan serve

and it gave following message

Laravel development server started on http://localhost:8000

When viewed from web browser in address http://localhost:8000, there is nothing, only blank page. When I browse this address, the server seems to quit.

I have following environment: OSX Mavericks; MAMP with php 5.4.10 and apache2; following extensions in php.ini file

extension=imap.so
extension=yaz.so
extension=mcrypt.so
extension=gettext.so
extension=pgsql.so
extension=pdo_pgsql.so
extension=pdo_mysql.so
;;;;;Following are added by me ;;;;no error when starting server
extension=openssl.so
extension=mbstring.so

When I run which php from command line, I get following.

/Applications/MAMP/bin/php/php5.4.10/bin/php

When I tried to run this in mamp ie localhost:8888, it gave 500 internal server error.

Please suggest me, where I might have made mistake.

I think you should move your Laravel Application to

/Applications/MAMP/htdocs/

and then you can access it on

http://localhost:8888/laravel-app

As a OSX user i strongly recommend you to use Laravel Homestead to develop your applications.

http://laravel.com/docs/5.0/homestead

You only need to install:

  • Virtualbox
  • Vagrant

I have my projects in ~/code folder, so everytime i create a new project, i just:

  • Add project test domain to my local host file (my-project.app pointing to localhost 127.0.0.1)
  • ssh into the homestead virtualmachine (homestead ssh)
  • run built in serve command (serve my-project.app /path/to/project/public)
  • Voilà

The most common reason for this is that the web server process does not have write access to the storage folder and its subfolders.

Set the permissions on the storage folder so that the web server can create files.

You don't have to use php serve, mamp does that for you. Make sure you point your directory to public folder. You can also use custom domain for each of your projects.

Also for Mac there is laravel valet. Easy to get started with many php projects.