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

go's avatar
Level 2

Deployment failing due to php artisan optimize

Hi,

In using Envoyer, deployment is failing when installing composer dependencies, where after doing so it runs php artisan optimize.

The error is that it is trying to access releases/(timestamp)/storage/logs but the directory does not exist.

Storage does exist in that location, as a symlink, and is listed when you run

find -type l

Heres a snippet of the error:

php artisan optimize
PHP Fatal error:  Uncaught UnexpectedValueException: There is no existing directory at "/home/master/whatever/releases/20170107052305/storage/logs" and its not buildable: File exists in /home/master/whatever/releases/20170107052305/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:161
Stack trace:
0 likes
1 reply
go's avatar
go
OP
Best Answer
Level 2

The solution to this problem was in ensuring that the Server information was correct.

For project path, let's say you need to put the application's public_html path, you can navigate there, and then type

pwd

To print the current working directory's path.

This will allow you to see the full path, including folders that are further up the chain that you may not be able to see depending on how your host is set up.

Additionally, make sure the other information is correct, such as choosing the correct server PHP version, such as PHP 7.0 instead of PHP 7.1.

1 like

Please or to participate in this conversation.