1

I've added the project file to the htdocs file in my mac and exported the database , composer install is working fine , php artisan-migrate gives me an error of duplicated database and tables .. but when i run php artisan serve it gives me error and won't run on localhost:8000 Here is the error i get

[ErrorException]
chdir(): No such file or directory (errno 2)
tkausl
  • 13,686
  • 2
  • 33
  • 50
Abdul-Elah JS
  • 685
  • 1
  • 16
  • 36
  • 2
    Please don't use phrases like "Please help me ASAP" in your question. – tkausl Aug 21 '16 at 01:07
  • !! .. Didn't know that it's prevented .. Thanks anyway – Abdul-Elah JS Aug 21 '16 at 01:13
  • 1
    Possible duplicate of [laravel5: chdir(): No such file or directory (errno 2)](http://stackoverflow.com/questions/30873773/laravel5-chdir-no-such-file-or-directory-errno-2) – James Aug 21 '16 at 03:57

2 Answers2

0

This usually occurs because Laravel cannot find your public folder.

One solution, suggested here, is to change this line:

chdir($this->laravel->publicPath());

in vendor/laravel/framework/src/Illuminate/Foundation/Console/ServeCommand.php to:

chdir('/');

See if that works for you.

Community
  • 1
  • 1
James
  • 15,754
  • 12
  • 73
  • 91
0

Empty your database and then run php artisan migrate. Then use

For serve error :

it means that your Laravel Application Can't Find the public folder.

Change

chdir($this->laravel->publicPath());

in vendor/laravel/framework/src/Illuminate/Foundation/Console/ServeCommand.php To :

chdir('/');
  • php artisan migrate gives me new error now -_- "[Illuminate\Database\QueryException] SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'sessions' a lready exists (SQL: create table `sessions` (`id` varchar(255) not null, `p ayload` text not null, `last_activity` int not null, `user_id` int unsigned null) default character set utf8 collate utf8_unicode_ci) " and another error that i will post in the next comment – Abdul-Elah JS Aug 22 '16 at 06:24
  • here is the other error " [PDOException] SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'sessions' a lready exists " – Abdul-Elah JS Aug 22 '16 at 06:25
  • Can i contact you on private ? – Abdul-Elah JS Aug 22 '16 at 07:03
  • Yes. you need to empty all table and then run migration – Abhishek Chaurasia Aug 22 '16 at 07:17
  • I did .. and got this error -_- [Illuminate\Database\QueryException] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'justnew.settings' doesn't exist (SQL: select * from `settings` where `settings`.`id` = 1 limit 1) – Abdul-Elah JS Aug 22 '16 at 08:10
  • Please check if database 'justnew' has that name table 'settings'. Your connection config might be doing problem please check your config from config/database.php . – Abhishek Chaurasia Aug 22 '16 at 09:47
  • can i have your twitter account or any account to contact with you on private and send you couple of screenshots .. it would be very helpful – Abdul-Elah JS Aug 24 '16 at 07:34
  • https://www.facebook.com/profile.php?id=100006738768037 contact me here – Abhishek Chaurasia Aug 24 '16 at 07:42