Can't make Laravel 4 to work on localhost

前端 未结 14 1926
梦毁少年i
梦毁少年i 2020-12-01 05:18

I\'m trying Laravel for the first time after reading an announcement of the Laravel4 beta releasing.

I followed these steps I installed composer and laravel with all

相关标签:
14条回答
  • 2020-12-01 05:55

    Production way, moderate complexity for people not familiar with Unix, but more secure:

    1. Go in super user mode (sudo -s or su).
    2. Create group web (groupadd web)
    3. Add you main user to group web (suppose your user is cool_user, so run usermod -a -G web cool_user)
    4. Add php-fpm or web server user (if php is used as a SAPI module) to web group (for example, on CentOS php-fpm utilize apache user name, so in most cases this will work: usermod -a -G web apache)
    5. Change your project root directory group owner to web recursively (chgrp -R web /path/to/project/root/)
    6. Grant recursively write permission for group (chmod -R g+w /path/to/project/root/
    7. Optionally To allow all newly created by apache (or some other) user files and folders be accessible from your user, make them receive group ownership same as their parent folder by setting groupid bit recursively on your project root directory (chmod -R g+s /path/to/project/root/).

    Voila!.

    Fast and dirty way, for those who doesn't care about security and want make it works at any cost, not secure:

    1. Go in super user mode (sudo -s or su).
    2. Grant recursively full permission (read, write, execute) for all users (chmod -R o=rwx /path/to/project/root/
    0 讨论(0)
  • 2020-12-01 05:58

    further to above, if you're using a virtualbox/vagrant VM type environment, then on my Mac I needed to issue the chmod on the host (mac) system but on my Windows box, it was fine issuing the chmod direcly on the VM.

    0 讨论(0)
  • 2020-12-01 05:59

    The webroot of your server should point to the /public folder of your Laravel installation. This is where the index.html file recides from where Laravel is initialized.

    0 讨论(0)
  • 2020-12-01 06:00

    Your errors resulted because laravel couldn't write to the app/storage folder. The rest was just a stack trace. In order to make the storage folder writable, cd into your app folder and then run:

    chmod -R 777 storage
    
    0 讨论(0)
  • 2020-12-01 06:01

    Hey I got this error too and changing the write permissions didn't seem to work either. It turned out I needed to change the User and Group settings in apache's httpd.conf file. Here's a good tutorial for it: Enable Write Permissions for the Native Built-In Apache in Mac OS X Lion

    0 讨论(0)
  • 2020-12-01 06:02

    I ran into this problem a few minutes back and using sudo chmod -R 777 storage seemed to help make the storage/meta/services.json writable. Just to add to what everyone has been saying. This worked for me.

    0 讨论(0)
提交回复
热议问题