Search code examples
composer-phpbitbucketphp-deployer

Am I missing something when deploying using bitbucket repo and composer deployer?


I am trying to deploy my WordPress site from local to staging. I'm able to deploy the files up to my hosting site but now I'm getting an error in Chrome when I'm trying to access my site http://staging.responsivhub.com/

After uploading my site to my webserver "siteground" in public_html/staging and have changed my subdomains root location to public_html/staging/current/web. After that I'm getting this error

Warning: 
require_once(/home/user/public_html/staging/releases/1/vendor/autoload.php): 
failed to open stream: No such file or directory in 
/home/user/public_html/staging/releases/1/web/wp-config.php on line 7

Fatal error: require_once(): Failed opening required 
'/home/user/public_html/staging/releases/1/vendor/autoload.php' 
(include_path='.:/usr/local/php71/pear') in 
/home/user/public_html/staging/releases/1/web/wp-config.php on line 7

(I have replaced my username to user)

I can't figure out what I'm missing.


Solution

  • You need to create the web/wp-config.php files inside the shared folder with the database credentials and all the WordPress configuration.

    Go to (with the webserver/deploy user):

    mkdir /home/user/public_html/staging/shared/web
    vim /home/user/public_html/staging/shared/web/wp-config.php
    

    And then include the configuration inside that file. After that try to re-run the deploy. I'm not sure if the wp-config.php file is on the root folder so you can try to remove web/ folder when running the commands.