this is my second laravel project running on the same machine. the first works just fine.
I use xampp for the projects.
after I install another fresh new version(5.4) laravel, when I run
artisan serve
phpstorm tell me
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in E:\xampp\htdocs*****\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 549
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in E:\xampp\htdocs*****\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 549
Process finished with exit code 255 at 13:58:28. Execution time: 4,976 ms.
I tried other post about this, and tried to change php.ini. It does not apply to my case.
This doesn't sound like a server setup issue. This is a Laravel setup issue. Increasing memory_limit in the php.ini will not fix the issue in your case. Laravel will commonly throw unhelpful errors if not setup correctly.
After running composer, make sure before you try to run php artisan serve
that you have done the following.
/public
folder/storage
are 777
. /storage/logs/laravel.log
<- here you will find your real error..env
aka a copy of .env.example
php artisan key:generate
Also be careful that you don't have any spaces when creating your variables in your .env
file this will cause problems as well.
DB_DATABASE=my database name
DB_DATABASE=my_database_name
Lastly if you are running something like MAMP you may have to include a UNIX_SOCKET
variable in your .env file like so:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database_name_here
DB_USERNAME=root
DB_PASSWORD=root
UNIX_SOCKET=/Applications/MAMP/tmp/mysql/mysql.sock
and create the variable in your /config/database.php file
'mysql' => [
'driver' => 'mysql',
...
'engine' => null,
'unix_socket' => env('UNIX_SOCKET','')
],