sOltan
sOltan

Reputation: 493

Moving Laravel 5.1 website from localhost to web host

My Laravel 5.1 website works fine on my localhost. I moved all folders to a "laravel" folder I created off root at the host. Host is running php 5.6. Then moved the index.php (originally in the laravel public folder) to public_html at the host. Made some edits to the index.php for it to see bootstrap. I could see the front login page, and at that point it's not making any calls to the database. My next step was to run artisan migrations to create the database and seed it. When I ran:

php artisan migrate:refresh 

I got this error:

Parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE or '$' in /home/myself9/laravel/artisan on line 31

and that line happens to be:

$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);

I verified that the required php extensions are installed with my host's php rev 5.6

OpenSSL PHP Extension PDO PHP Extension Mbstring PHP Extension Tokenizer PHP Extension

Any ideas?

enter image description here

Upvotes: 0

Views: 1276

Answers (2)

Afshin
Afshin

Reputation: 350

Just add a cronjob like this:

* * * * * /usr/local/bin/php /home/YOUR_USER/domains/YOUR_DOMAIN/artisan migrate:refresh >> /dev/null 2>&1

Upvotes: 0

Vishal Sharma
Vishal Sharma

Reputation: 2610

Okay, based on your last comment, I see that even composer isn't installed. You will have to Install composer using cURL in your shared host. Use the command below

curl -sS https://getcomposer.org/installer | php

(I hope that php is pre installed in your host)

Now, go to the directory where composer.json and composer.lock are located and run composer install this will install all the dependecies your project has.

As I said, this may be a partial solution but these are initial things that you need to do after moving your project to server. I will update this answer based on your further comments..

EDIT

If your server is a shared host, you will not be allowed to run composer directly. Move composer.phar that you downloaded using cURL to your project root and run php composer.phar install

Upvotes: 3

Related Questions