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

hazhayder's avatar

My Laravel is more than 1GB in size

Hello, I have been hosting a laravel website. When it was initially developed it size was just fine. But now after few months i want to make few changes i just go to file manager and compressed my Laravel application skipping storage and logs but still it is of more than 1GB in size. What should i check is there something i can delete ?

0 likes
16 replies
sutherland's avatar

You might be storing something somewhere other than your storage directory. I would open your project root in your terminal and run du -sh * to get a summary of the size of each subdirectory, and from there drill down into which is using a lot of space.

hazhayder's avatar

@sutherland This is the output of the command you given as you can see app.zip which is the compressed file of whole project is of 1.4GIG

204K    ../lcore/app
1.4G    ../lcore/app.zip
4.0K    ../lcore/artisan
32K ../lcore/bootstrap
4.0K    ../lcore/composer.json
140K    ../lcore/composer.lock
64K ../lcore/config
44K ../lcore/database
0   ../lcore/lcore
4.0K    ../lcore/package.json
4.0K    ../lcore/phpunit.xml
320K    ../lcore/resources
24K ../lcore/routes
4.0K    ../lcore/server.php
32M ../lcore/storage
28K ../lcore/tests
49M ../lcore/vendor
4.0K    ../lcore/webpack.mix.js
212K    ../lcore/yarn.lock
hazhayder's avatar

@jlrdw This is the file in which the whole project is compressed. After compressing this file i posted this post.

Cronix's avatar

that's not showing your /public dir. Do you have a lot in there? Images maybe?

sutherland's avatar

Are you running a process that creates that zip file? What does it look like? You might be including the previous zip in your new zip, making the result grow every time it gets zipped.

hazhayder's avatar

@Cronix The public folder is in public_html which is not included in this compressed file. I have separated both the frontend and backend of my laravel

hazhayder's avatar

@sutherland now i am not running any process that creates zip file. This one is created manually using cPanel's file manager. Secondly i posted all the directory and file sizes there is no such directory which has a size of more than 50MB.

skliche's avatar

Delete the zip file and run

du -chd 1 . | sort -h

in the root directory of your project. Vendor and node_modules can get pretty big, git as well.

hazhayder's avatar

I execute this command but no result returned.

jlrdw's avatar

You're not compressing the vendor folder are you? That is easily recreated.

Snapey's avatar

Do you have hidden folders, eg a git repository?

hazhayder's avatar

@Snapey I don't think so, Because this project was uploaded from my local PC and there is no such git and hidden files. Is there is any way to check if there is any hidden folder

hazhayder's avatar
hazhayder
OP
Best Answer
Level 1

i found the problem my laravel had some symlink to public_html and in public_html i have some subdomains which caused such a huge size zip file thanks everyone for the help

Please or to participate in this conversation.