• Resolved Antipole

    (@antipole)


    I am configuring SitePush for the first time. My live site is getting the error message from SitePush: DB config file present, but it cannot be read.

    Please can SKS suggest what might be wrong.
    My putative test site can be visited OK, so the WP install seems OK.

    In the following, <…> are strings that have been replaced in this post to protect my site. Both my live site and the putative test site are located in folders in /home/<mydomain>/public_html

    I have created a folder /home/<mydomain>/sitepush which contains the site config and dbs config .php files (and a folder for site push backups).
    The site config.php file is being read OK but the db config file is not – it appears. The files are in the same folder and both have permissions 644. Perhaps it can read it but there is something wrong with the content?

    My config.php file is as follows (not sure what wp_dir & wp_content-dir need to be set to?):

    [ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. ]

    <?php die('Forbidden'); ?> -*- conf -*-
    
    [all]
    wp_dir = /wp
    wp_content_dir = /wp/wp-content
    cache = no
    caches[] = /caches/timthumb
    caches[] = /caches/something_else
    
    [live]
    label = Live Site
    domains[] = <myURL>
    web_path = /home/<mydomain>/public_html/<site>
    db = live
    live = yes
    
    [dev]
    label = Dev Site
    domains[] = test.<myURL>
    web_path = /home/<mydomain>/public_html/test-<site>
    db = dev
    live = no
    </blockquote>
    and my dbs config .php file is thus:
    
    <blockquote>; <?php die('Forbidden'); ?> -*- conf -*-
    ; Do not remove the above line, it is all that prevents this file from being downloaded.
    
    [all]
    prefix = oo_
    
    [live]
    name = <live_db_name>
    user = <live_db_user_name>
    pw = <password>
    
    [dev]
    name =<test_db_name>
    user = <test_db_user_name>
    pw = <password>
    </blockquote>

    Any help will be much appreciated.

    https://www.ads-software.com/plugins/sitepush/

Viewing 15 replies - 1 through 15 (of 15 total)
  • Hi there,

    The wp_dir & wp_content_dir are the paths to your wordpress directory and the wp_content folder. If you have your wordpress install in the root directory then the wp_dir should be

    wp_dir =

    & wp_dir_content should be

    wp_dir_content = /wp-content

    but I wouldn’t think that is your problem for not being able to read the db config file. I would think you haven’t configured the right path in the sitepush options window of your live site.

    Thread Starter Antipole

    (@antipole)

    Thanks for responding. Please can you clarify further. The same configuration files are used by both live and push sites, I believe. So which site (live or test) should the wp_dir and wp_content_dir point to? It cannot be both.

    On the live site I have the config paths set to
    /home/<mydomain>/sitepush/<site>-sites-config.php
    /home/<mydomain>/sitepush/<site>-dbs-config.php
    and don’t see how the dbs one is wrong since the two files are in the same directory. In any event, before I got the path right it complained it could not find it. Now it says
    DB config file present, but it cannot be read.

    Any further help would be appreciated.

    I only ever make any changes to options in the live site so if your live website is installed in the root directory, the wp_dir means the path to your WordPress Directory and that would be wp_dir =

    because you leave out all trailing slashes so sitepush looks in the root directory. The path to the wp-content folder would then be wp_dir_content = /wp-content (again assuming your wordpress installation is installed in the root directory. I would only be concerned about the live site.

    Are you installing it in different vhosts or are you using one vhost with different folders?

    Thread Starter Antipole

    (@antipole)

    One host with different folders. My two sites are in sibling folders both within the folder
    /home/<mydomain>/public_html

    My live site is in
    /home/<mydomain>/public_html/<site>

    as shown in the original post. So I have set the two parameters without trailing / to
    wp_dir=/home/<mydomain>/public_html/<site>
    wp_dir_content=/home/<mydomain>/public_html/<site>/wp-content

    I hope I have understood you right.

    No difference in the error message.

    thanks for your perseverance.

    I don’t think you would need to put the full path in. My path is /var/www/<mydomain>/httpdocs/<files> and I use wp_dir =

    as Sitepush is able to detect the /var/www/<mydomain>/httpdocs/ part

    That still doesn’t solve your problem of not being able to read the file.

    I don’t mean to annoy you but have you checked that you definitely have the file names correct and definitely have the permissions correct. You could also try setting the folders above to 777 temporarily to see does that make any difference

    Thread Starter Antipole

    (@antipole)

    You ar not annoying me – just trying to help.

    The permissions are correct. I deliberately changed the name of the database config file by appending a ‘2’ to it. The plugin then complained it could not find it. So it must be looking in the right place and able to access the containing folder. I put the proper name back and gave it permissions of 777 but no luck. Then I have the enclosing folder 777 as you suggest – no luck. I have now restored permissions a they should be.

    I have been through the contents of the file and double-checked the settings, db name, pre-fix, user and password etc. by comparing with the wp-config.php file and cannot find anything amiss.

    It would be good to discover what is going on here. But meanwhile I have got my test site copied over and working otherwise. So I am not stuck.

    It’s a strange one I must say. I’ve never had an issue like that.

    I haven’t installed sitepush in the same vhost, always in different vhosts but that shouldn’t be causing any issue, it’s still supposed to work, just not play nice with cache plugins.

    The fact that it is reading the contents of the config file but not the db file in the same folder has me stumped. Have you tried replacing the contents of that file. I know one time I uploaded text into the db file but I had missed a couple of the first characters and it caused a problem until I rectified it.

    After that, I’m afraid I am of no help. What I can say is though, it’s worth trying to get it working because it’s a great plugin which makes life very easy if you’ve lots of content/dev to update.

    Thread Starter Antipole

    (@antipole)

    I have now copies the file contents into a simple text app to check there are no extraneous characters and then copies that back into TexWrangler, in which I edit text files on my server and have copies that back and checked the date has been updated.

    Still no luck. Ah well. Thanks very much for trying.

    Thread Starter Antipole

    (@antipole)

    I have done an experiment: I temporarily replaced the contents of my dbs config file with just the word “rubbish”. Upon SitePush options save, it complained about no databases defined, no live site defined and no dev site defined.

    This proves that the dbs config file is being read OK and that the error message “DB config file present, but it cannot be read.” is erroronius. The file is being read OK but something else is causing the error message, which is the wrong message.

    Could you please have a look at how this message might be triggered even when the file can be read OK?

    My dbs confg file contains (with some details edited for security here):

    ; <?php die('Forbidden'); ?> -*- conf -*-
    ; Do not remove the above line, it is all that prevents this file from being downloaded
    
    [all]
    prefix = oo_
    
    [live]
    name = xxxxxxxxx
    user = xxxxxxxxx
    pw = ************
    
    [dev]
    name = yyyyyyyyy
    user = yyyyyyyyy
    pw = ************

    Thread Starter Antipole

    (@antipole)

    A further test: I removed just the [dev] section. The error message complained that Database dev in config for site Dev Site is not defined in database config file.

    This proves that the file is being read OK and the stuff before that point is not causing the error.

    The error message about not being able to be read the file must be generated after it has been read OK and in the subsequent processing.

    I’ll go through the Sitepush documentation later on and see if I can come up with anything else on it

    Everything looks ok to me in that config file. I’m assuming your database prefix is actually oo_? and not wp_?

    I would recommend you delete the dev database and set up from scratch. It’s not liking something to do with that database. I’d set it up again and ensure you put the exact credentials in to the config file.

    Thread Starter Antipole

    (@antipole)

    Re DB name – yes you are correct – same pre-fix in both databases.

    Big progress – almost there!

    I tried moving a fresh copy of the database from my live site to the test site, using WordPress Move’s migration assistant, which is how I got my test site working while SitePush has not been. Same problem.

    So I then set up a completely fresh test site from scratch with just SitePush installed. That error went away and I got others that helped me sort out my SitePush config file, now:

    wp_dir =
    wp_content_dir = /wp-content

    Whereupon, it started to work and I have been able to push my live site to my new test site… except that:
    I have inserted into the wp-config.php file on my test site only:

    // Need these to make this site work with SitePush
    define( ‘WP_SITEURL’, ‘https://testsite.<domain>&#8217; );
    define( ‘WP_HOME’, ‘https://testsite.<domain>&#8217; );

    Having done that I can log in to the admin panel on my test site and everything seems to be there. In Settings>General the WordPress Address and Site Address are both set to the test site and greyed out (which seems correct).
    But as soon as I visit the site itself, I end up back on the live site.

    I have tried re-pushing the database and content with and without the Fix site URLs ticked. I think I do not need it ticked? – I want to see when I am on the test site.

    So almost there – what am I still missing?

    Thread Starter Antipole

    (@antipole)

    Hold on – it is working now – not sure why not before. I am in business!!

    (And I do need the Fix Site URLs ticked, so my menus work.)

    Thanks for your perseverance. I look forward to putting SitePush to work.

    That’s great news. Glad you got sorted. Best of luck with SitePush

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Configuring SitePush – help please’ is closed to new replies.