Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

davy_yg's avatar
Level 27

php artisan

Hello,

When I typed php artisan in command prompt it does not recognize the syntax, any clue why?

What do I need to install to make it works?

0 likes
8 replies
bobbybouwmann's avatar

@jlrdw Don't be a dick!

You need to make sure that you're in the directory of your Laravel project. Also you need to run composer install so all dependencies are available!

davy_yg's avatar
Level 27

D:\xampp72\htdocs\redbuzz>laravel

'laravel' is not recognized as an internal or external command, operable program or batch file.

Snapey's avatar

what about when you try to run artisan command. What do you type / see

davy_yg's avatar
Level 27

D:\xampp72\htdocs\redbuzz>php artisan

'php' is not recognized as an internal or external command, operable program or batch file.

Tray2's avatar

Then you need to add the folder your php.exe is in to your path.

jlrdw's avatar

From a year ago

davy_yg
•
a year ago
172
4
Laravel
migration

When trying to migrate table I get this:

C:\xampp\htdocs\shopee_lvl\framework>php artisan migrate Migration table created successfully.

Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users2 add unique users2_email_unique(email))

at C:\xampp\htdocs\shopee_lvl\framework\vendor\laravel\framework\src\Illuminate\Database\Connection.php:664 660| // If an exception occurs when attempting to run a query, we'll format the error 661| // message to include the bindings with SQL, which will make this exception a 662| // lot more helpful to the developer instead of just the database's errors. 663| catch (Exception $e) {

    664| throw new QueryException( 665| $query, $this->prepareBindings($bindings), $e 666| ); 667| } 668|

Exception trace:

1 PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes") C:\xampp\htdocs\shopee_lvl\framework\vendor\laravel\framework\src\Illuminate\Database\Connection.php:458

2 PDOStatement::execute() C:\xampp\htdocs\shopee_lvl\framework\vendor\laravel\framework\src\Illuminate\Database\Connection.php:458

Please use the argument -v to see more details.

C:\xampp\htdocs\shopee_lvl\framework>

The table does exist yet I cannot view it from the table tree structure.

He knows about php artisan. He has run migrations.

I usually know of what I speak.

I am sure one of the above will willingly forget, but that person has mentioned in the past to the OP that they have used laravel for quite a while, yet asked already learned question numerous times.

But just my 2 cents.

Reference: https://laracasts.com/discuss/channels/laravel/migration-7

Don't be a dick!

Ditto.

Please or to participate in this conversation.