I use for a long time CodeAnywhere to develop my application via FTP, or to use shell server console via SSH.
Now i want to use the Container and try to create a Laravel PHP application.
But i have encountered some errors that i want to report you.

Now start with the creation of the container, with the “Connection Wizard” is very simple:

If we want to run the Laravel php application, we must to use this command, and set the ip 0.0.0.0 to use app from remote container url.

https://phpbox-CODEOFCODEANYWHERE.codeanyapp.com/

[cabox@PHPBOX app]$ php artisan serve --host=0.0.0.0 --port=8000
Laravel development server started: http://0.0.0.0:8000

Some possible error

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

Edit your app/providers/AppServiceProvider.php file and inside the boot method set a default string length:

use Illuminate\Support\Facades\Schema;

public function boot()
{
    Schema::defaultStringLength(191);
}

SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘users’ already exists

Solution is to run con shell

[cabox@PHPBOX app]$ php artisan migrate:fresh
[cabox@PHPBOX app]$ php artisan migrate
Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *