3

I am try to run Laravel app in Ubuntu 16.04 Apache server.

It is show server error as fallows

This page isn’t working
localhost is currently unable to handle this request.
HTTP ERROR 500

but i run it on development artisan server using below command and its working.

php artisan serve --host=192.168.2.103 --port=8050

pls can you explain what i have done wrong way in Apache server and how to do it correctly.

3
  • 1
    A 500 error is a generic error message and covers pretty much every single thing that can go wrong with a script. Check your server error logs to find out the exact error message. Make sure you've run composer install to populate the vendor files, and composer dumpautoload. Commented Sep 17, 2018 at 12:41
  • I was run Both command and result is Generating optimized autoload files > Illuminate\Foundation\ComposerScripts::postAutoloadDump Commented Sep 17, 2018 at 12:45
  • Hi, any news about this issue? Commented Feb 9, 2021 at 12:59

1 Answer 1

1

STEP 1

cd /etc/apache2/sites-available/

STEP 2

sudo cp 000-default.conf yourprojectName.conf

STEP 3

sudo vi yourprojectName.conf(you should know vi editor command)

STEP 4

Update below code

        ServerName siteexample.co.in

        DocumentRoot /var/www/project/public

        <Directory /var/www/project/public>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order Allow,Deny
                Allow from all
        </Directory>

colse the editor

STEP 5

sudo a2ensite yourprojectName.conf

STEP 6

sudo service apache2 restart

Now will work

Congratulations!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.