Home > Blockchain >  500 Server Error when trying to deploy locally on Xampp or Wamp for a repo on GitHub
500 Server Error when trying to deploy locally on Xampp or Wamp for a repo on GitHub

Time:08-09

Hi All I have been trying to deploy the following webapp I found on github.(enter image description here

Im not sure what to do from here, I would like to use this to create a personal project that is of interest to me.

here is my virtual host information:

<VirtualHost *:80>
    ServerName storemanager2.com
    DocumentRoot "C:/xampp/htdocs/storemanager/public/"
</VirtualHost>

CodePudding user response:

Do you have a .htacces file setup? because I see you are running in a production environment.

If you are running in a production environment you'll need a .htaccess.

Try this;

  1. Open phpmyadmin and create a database for your project.
  2. Create a .env file and copy the contents from .env.example and paste into it.
  3. In your .env file replace the following fields with your database credentials
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=yourdatabasename
DB_USERNAME=yourmysqlusername
DB_PASSWORD=yourmysqlpassword
  1. In command line cd to your project directory and follow all installation instructions in repo.

  2. in command line type PHP artisan serve.

if you are in a production environment as above create a .htaccess file and copy the code below to it.

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization MemberHeader
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (. )/$
    RewriteRule ^ %1 [L,R=301]
    
    RewriteCond %{REQUEST_URI} !^/public/
    RewriteRule ^(.*)$ /public/$1 [L,QSA]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

Should work fine now.

  • Related