ISPConfig and Wordpress installation | Error 500.

Discussion in 'Installation/Configuration' started by Maurizio Paolo, Jul 15, 2020.

  1. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    And just to make sure the log directory is setup correctly, you do see new entries in the access.log when you attempt the worpress install?
     
  2. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    there's also no indication that you've checked any of this as suggested earlier:

    mysql not working at all, or not working correctly, could explain most, if not all or your problems. i'd check connectivity to that first.
     
  3. Endre Utchay

    Endre Utchay New Member

    I had exactly the same problem on a fresh VPS installation with Debian Buster + ISPconfig 3.2
    I moved a complete wordpress website to a new server.
    I set up FTP user and database in ISPconfig.
    I have changed the document root in SQL export file and imported it into the newly created database using phpmyadmin.
    I have uploaded all wordpress files using FTP.
    I have deleted index.html file, hit F5 on the browser showing the moved domain and then came error 500 and the nice WP error message "Failed to estabilish database connection".
    I tried connecting to the WP database using a simple php file. The connection falied with the message: "Connection failed: No such file or directory".
    Then I started googling and found this thread.
    I have changed "localhost" to "127.0.0.1" and the connection is now successful, but the wordpress site still failed to load saying there was a fatal error.
    I have enabled debugging in wp-config but the debug log is empty.
    The error.log file contains only records of those failed database connection attempts made using the simple test file.
    I have renamed my wp-content folder, deleted the wp-config and uploaded a "clean" wordpress to the site root but now i get the following error: "One or more database tables are unavailable. The database may need to be repaired."
    Can you suggest where to look further?
     
  4. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    You could try repairing the old db as the message indicates. It's possible problems came in with your phpmyadmin changes (eg. a global search and replace will likely corrupt serialized php data, which can cause issues).

    Next I'd start with a new/clean database as well as clean wordpress install, and assuming that works, see if you can export data from your old site and import into the new db.
     
  5. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    do you still have access to the site on it's old hosting? if so, install the plugin 'duplicator' by snap creek on there, and use that to create a backup of the site and database in a single file, and an installer.php file. download both, and upload them to the /var/www/domain.tld/web/ folder on this new server.
    browse to the the new sites url, appending installer.php to the url, and it'll start the installation process for the site
    that will ask for database details, and extract and install your site backup, fixing any domain name changes, or filepath changes that may be needed in the database. it's by far the easiest way to move a wordpress site to a different system.
    forget about trying to change anything except maybe just the home or siteurl in the sql export file, trying to change file paths and domain names directly in there requires all sorts of complicated regex chicanery, especially where you also need to change all the wordpress string length data as well.
     
  6. Endre Utchay

    Endre Utchay New Member

    Seems like at some point of installation I have enabled chrooting and that is causing a lot of troubles for me now.
    I found that PHP has problems with timezone settings as "/etc/localtime" and "/usr/share/zoneinfo" are unaccessible to the webserver and/or the php service.
    Setting the default timezone in php.ini solved this problem and the site is now running.
    I feel that quite possibly there are other problems caused by chrooting the web process and soon I will found the site to become unavailable again :(
    I spent half of my day setting up the VPS following "The Perfect Server - Debian 10 (Buster) with Apache, BIND, Dovecot, PureFTPD and ISPConfig 3.1" guide.
    I did set up other linux based servers before using Centos 7 and Plesk admin panel (and one with Mail-in-a-box, and another running OpenMediaVault) and those were much easier.
    Now the budget is much lower for this project so first I thought not using any admin panel, but soon I found that setting up web, FTP and email servers, configuring security and access rights correctly is way beyond my knowledge of linux. I tried CWP and ApisCP but I could not make those work as I needed. This is where I got to ISPconfig.
    This panel looks much more usable than ApisCP but I find it more complicated than Plesk or cPanel. I hope I can get this one to work as I do not see any other alternatives to complete this project.
    Sorry for the long story I am a bit tried and sad now.
     
  7. Endre Utchay

    Endre Utchay New Member

    Next time i will try this duplicator plugin. I have seen that is really popular but I always made moving sites this manual way and most of the time I did not have problems with it.
    The real root path appeared only 9 times, so calculating the difference of string lengths was not much work to do.
     
  8. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    looks like you got lucky with the file paths then. guess it depends a lot on the plugins used. i've tried the manual editing of sql exports of wordpress sites before, it's not so bad if the file path length doesn't change, or the domain length if the domain is being changed as well.
    can be a real nightmare if the lengths do change, i've seen loads requiring more than 50K changes, and several requiring more than 100K changes.... it's definitely motivation to find a simpler method.....
    i really wish the whole wordpress system (and all plugins) would just use relative filepaths, the whole issue with migrations would just disappear.
     
  9. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    A small tip for ISPConfig systems, if you use the new feature to chroot php-fpm, all your website paths will be '/web' from both the php and shell (jailed) environment, which would make copying the sites a little easier. (vhost subdomain/aliasdomain will still use a different path)
     
  10. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    yeah, that would make things a bit simpler when just moving sites, won't help much if the domain name itself is changing to a domain with a different string length. wordpress still includes a mess load of links in the database using the full url of the website, and specifies the whole expected string length of the entire passage of text, so the regex has to identify and change the domain string where the length isn't specified, without changing anything else, and the domain string where the length is specified, by a seemingly random number, that precedes the string needing to be changed by a length that is itself variable.
    the regex ends up being a very long string itself, mostly composed of lots of \, /, {, }, (, and ) with a few letters and numbers interspersed.
    not nice. o_O
    fortunately even that can be simplified a lot now using wp-cli to do the search and replace after importing the database into mysql.
     

Share This Page