Can't Make Laravel 4 to Work on Localhost

After laravel installation localhost doesn't work

So from the chat we had in the comments we came to the following conclusions:

  1. You're using a linux(ubuntu) server.
  2. You're using lamp, more information about lamp can be found here
  3. You're trying to run lamp (localhost) and laravel (localhost:8000) together.

With this information i think the issue is within the laravel and localhost application combined. There are a couple of things we should keep in mind

  1. To run laravel on a localhost:8000 environment be sure to run the following command php artisan serve.
  2. The configuration as told in older answers should be set right in laravel
    • Give 775 permission to storage & bootstrap folder inside laravel folder and access url through html/laravel/public. *credits to: @vijay_Kashyap
  3. Check the .conf file of apache and make sure all items are set right.

    • Look for the file: 000-default.conf -> tutorial

Even if all these things are set correctly the mistake could still appear due to wrong url-rewriting or the server that clashes with the laravel installation.

If you're sure that the above settings are set correctly you should take a look at the configuration of your lamp installation and the setup steps of laravel. Think about some of the following things:

  • Are the right packages installed
  • Is everything up to date -> command: sudo apt-get upgrade, sudo apt-get update (use -dist in case you're not completely sure).
  • Is Apache's mod rewrite enabled? -> sudo a2enmod rewrite
  • Did you install composer -> curl -sS https://getcomposer.org/installer | php
    sudo mv composer.phar /usr/local/bin/composer
  • check my_app.conf (if exists in your case).

If none of these things work for you it maybe would be an idea to restart from the beginning. Maybe you've made some changes to files you didn't need to change but forgot about them due to frustration etc. (happend to me the first time i installed multiple application types).

I would also like to refer you to laracasts and this tutorial about lamp

Since i'm not able to review the server for myself i can't give you much more information at the moment. Do ask questions if anything is unclear or new errors occur.

Hope this helps!

Laravel 4 not working

Try
localhost/yourfolder/public

Run laravel project in localhost

Try to run in different port

php artisan serve --port=9000

and then try http://127.0.0.1:9000 will work.

As might be on port 8000 something already running on your system will not make it work.

And you can also run your laravel project without artisan serve command

If anyone wants to make the application public, the more easy and fastest way is:

  1. Rename the "server.php" file in root directory, in "index.php"
  2. Move your .htaccess from public folder to root directory
  3. Make your directory accessible to Apache2 (set all file permissions
    to 777).

laravel app won't appear on localhost

First things, make sure both Apache and MySQL are running.

Move to the root project directory, fmvcei in your case, then run this command php artisan serve. you can browse by 127.0.0.1:8000

NB. you need to install composer if you don't yet.

Laravel route throwing: cannot find localhost

Try using

HTML::link_to_action('articles@write', 'New article');

and set up your root URL right in the application/config/app.php to http://localhost or http://127.0.0.1!



Related Topics



Leave a reply



Submit