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

dipcb05's avatar

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

I want to host my site in local server, i copied the project folder and paste it to /var/www/html/public_html

then i followed this one to host - https://www.interserver.net/tips/kb/deploy-laravel-project-apache-ubuntu/

i tried to install composer in /var/www/html using super user mode, then i found this error-

Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi Could not open input file: artisan Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

i comment out that function, still error occurred.

what i do now

0 likes
2 replies
MichalOravec's avatar
cd to-your-folder

Copy your project from root, so without another directory.

artcore's avatar

or add an alias to your .bashrc

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi

# User specific aliases and functions
alias a='php /home/user/laravel/artisan'
alias c='composer --working-dir=/home/user/laravel'

example would be "a cache:clear" and "c dumpautoload"

Please or to participate in this conversation.