1

I searched everywhere but i really can't find anything. I am trying to run php artisan but it seems that it just doesn't work.

Specifically i run this command when i am connected through ssh :

/opt/cpanel/ea-php71/root/usr/bin/php artisan

It is the same with php artisan but i am choosing a specific php version (7.1.5). This command should normally show up the rest of artisan commands.

The error i get :

PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 4096 bytes) in /home/username/laravel/vendor/composer/autoload_static.php on line 274

My hosting provider tried to increase the memory limit but nothing happened. I tried increasing it a lot through .php files too.

Also i have tried running composer install/update/clear cache/dump autoload.

Please ask for further information if needed,

Any ideas?

5
  • 2
    That's 2MB of memory. You expect to run a Laravel app on this? Get a better server. Commented Jun 1, 2017 at 13:09
  • You might have incorrectly set the memory limit to just 2MB. Which is way to low to run any php script. Commented Jun 1, 2017 at 13:18
  • Memory is set to 128MB, this is what php -i and echo phpinfo(); shows Commented Jun 1, 2017 at 13:22
  • @Sandeesh Where should i put the ini_set('memory_limit', -1) to make a test but being sure it runs before the php artisan command? Commented Jun 1, 2017 at 13:24
  • If you've set the memory limit in php.ini, you don't have to set the limit explicitly. Restart your server and it should take effect. As for composer, it runs it's own php script and doesn't invoke any of laravel files. For artisan you can set the limit in artisan.php file, though it's not recommended to modify them. Commented Jun 1, 2017 at 13:27

1 Answer 1

2

Try to check spelling in the php.ini file. That happened to me when I set memory_limit = 512MB (that is false) instead of memory_limit = 512M (wich is correct). For some reason php understood it as 2MB of memory.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.