Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deployer - Fatal error: Call to undefined function server()

Deployer version 4.1.0

When running dep deploy test the following error is reported:

PHP Fatal error: Call to undefined function server()

server ftn is defined as follows in config file:

// Configure servers
server('test', 'test.server.com')
    ->user('user')
    ->identityFile('~/.ssh/id.pub', '~/.ssh/user', 'password')
    ->stage("test")
    ->env('deploy_path', '/var/www/project.com');  

This is pretty much the standard as per the Deployer site. Has anyone else experienced this issue? If so how did you resolve it?

like image 698
mcv Avatar asked Mar 11 '23 01:03

mcv


2 Answers

SOLUTION

Fixed issue by running the following cmd (Suggested in comments above by Ken)

dep init

Compared the auto-generated deploy.php file to the original. Noted that the following was omitted:

namespace Deployer;

Also noted that ->env has been replaced with ->set

like image 124
mcv Avatar answered Mar 19 '23 13:03

mcv


I had the same problem using deployer on a Laravel 5.4 project:

I had installed deployer using composer, when removed it and worked with deployer.pharfile , everything worked fine.

like image 31
ako Avatar answered Mar 19 '23 12:03

ako