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

stueynet's avatar

Make deployment error screen more friendly

Whenever I deploy using Forge, if I visit the page mid deployment I get the error screen

Parse error: syntax error, unexpected '\Foundatio', expecting \\ (T_NS_SEPARATOR) or ';' or '{' in /home/forge/develop.xxxxxxxx.ca/bootstrap/cache/compiled.php on line 1986

Here is a screenshot for better reference. http://d.pr/i/1blIY

This only happens for a few seconds. However I was hoping there is a way to instead display a more friendly message indicating we ate down for maintenance or whatever.

0 likes
5 replies
bobbybouwmann's avatar
Level 88

You need to php artisan down before deploy and php artisan up after deploying. This way your application will be offline for a small amount of time. I believe it gives you a 503 error, so you can create a page for that as well ;)

1 like
stueynet's avatar

Hey I thought I would also follow up here. It strange but I get my custom 503 page now that I am doing php artisan down first. However if I hit refresh over and over occasionally I still get the error screenshotted above. Here is my deploy script.

cd /home/forge/default
php artisan down
git pull origin develop
composer install --no-interaction --no-dev --prefer-dist
php artisan migrate --force
php artisan cache:clear
php artisan up

Is there an ordering problemo?

Also I have removed any blade directives and php code from 503.php file since the site is down (I think that makes sense?)

bobbybouwmann's avatar

This looks fine for deployment. I think you just overload the server, not sure though. If you just use a clear message on the 503 page that the site will be back in a few minutes and you should be good to go ;)

stueynet's avatar

Yeah the issue is right before the end of the whole process, I still get that screen above. I will keep looking at it.

Please or to participate in this conversation.