Wow, I have been at this all night one problem after another after another, and it probably all would have been faster just to do a fresh OS/XAMPP install.
None the less, my problem right now is "Error establishing a database connection"
I think it is due to some type of miscommunication with mysql but I have no idea what as my config files wern't changed.
My ip, http://174.118.169.84
, currently loads to
http://174.118.169.84/wordpress/index.php
It all started yesterday when I tried to fix a localhost problem in that the wordpress site wasn't loading on the net, but returning access denied. I had just got it working when apache appeared to uninstall itself from xampp.
I rebooted to find that apache2 had installed itself --but not in the xamp directory and xampp apache (lampp now returned a weird error. Basically saying apache is gone, the rest of xampp appeared to work but /xampp was stripped down and was in the german furfor xampp. Myphpadmin also appeared to disappear. I think there was an update to php7 involved, and then php5 was reinstalled as it was missing.
XAMPP: So for the apache part it gave 4 lines saying we don't know what is going on.
XAMPP: XAMPP-MySQL is already running.
XAMPP: XAMPP-ProFTPD is already running.
XAMPP for Linux started.
Anyway... I thought maybe I could just redirect the new apache2 to xampp directories by changing the apache directory from var/www to /opt/lampp/htdocs and changing some directory permissions.
This appeared to work at changing the www/var directory to direct to xamps index.php, and using the wordpress directory but it returns the database error now, and I think something is broken between mysql or myphpadmin and the wordpress site.
To me it seems like a configuration error but I havn't got the slightest idea what it is.
My wp-config.php is as follows
<?php
/** Enable W3 Total Cache */
define('WP_CACHE', true); // Added by W3 Total Cache
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the
* installation. You don't have to use the web site, you can
* copy this file to "wp-config.php" and fill in the values.
*
* This file contains the following configurations:
*
* * MySQL settings
* * Secret keys
* * Database table prefix
* * ABSPATH
*
* @link https://codex.wordpress.org/Editing_wp-config.php
*
* @package WordPress
*/
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');
/** MySQL database username */
define('DB_USER', ''THIS IS THE CORRECT USER'');
/** MySQL database password */
define('DB_PASSWORD', 'MY PASSWORD IS HERE');
/** MySQL hostname */
define('DB_HOST', 'localhost');
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8mb4');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
/**#@+
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
define('AUTH_KEY', 'vM,M&|?i07!XaK|/bGbY}2<n)QSB(+J~{Dpu{0iq_<?)GO;h>>o2)IS[F$2<00F:');
define('SECURE_AUTH_KEY', '1$U$x&;*))MU5.oA3*t+^x8&m[85DbVXZ+$lNj(V^<sn^N4QQ>`}]XMLymHtV_VP');
define('LOGGED_IN_KEY', '-J ?|+Sq#@z)]zVN<!y@]9J`kz|O??CcpG/|D~isgk/|]TZVRm]cR?60rmlD~Q)P');
define('NONCE_KEY', '?oO4^?xN[olwoiuxt{dn5{epy[8TvX:^;!TW]7(CQ!gg$c^?&Gn(=z+tNRnH/7+T');
define('AUTH_SALT', 'Qzn|>5AfMtf}y_h{fl yZgf$hF/?ulE^j(Sr/Te)]|!4,arB;zN%cpoKdv,h}g,e');
define('SECURE_AUTH_SALT', '&8%YFhxS7*;DGDG^=U57+Yl4p{]MUg!ex:tnHw7hucsTPyG$q9?,A@SEVAY!9%/]');
define('LOGGED_IN_SALT', '*QaQ}xp6nT6vf=cZ*OVs6n X&mW`z@{XT]/)<R]A09,~nNEp^SOtS? Fx.XHY~-B');
define('NONCE_SALT', 'F(Qvy!iJT|QD6iWankVMkzy{#~k.b7z;j,#/P-&)_$Pr3AK4f(L^pcE]6OyT5)F^');
/**#@-*/
/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the Codex.
*
* @link https://codex.wordpress.org/Debugging_in_WordPress
*/
define('WP_DEBUG', false);
/* That's all, stop editing! Happy blogging. */
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
my htdocs
# BEGIN W3TC Browser Cache
<IfModule mod_deflate.c>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/bmp application/java application/msword application/vnd.ms-fontobject application/x-msdownload image/x-icon application/json application/vnd.ms-access application/vnd.ms-project application/x-font-otf application/vnd.ms-opentype application/vnd.oasis.opendocument.database application/vnd.oasis.opendocument.chart application/vnd.oasis.opendocument.formula application/vnd.oasis.opendocument.graphics application/vnd.oasis.opendocument.presentation application/vnd.oasis.opendocument.spreadsheet application/vnd.oasis.opendocument.text audio/ogg application/pdf application/vnd.ms-powerpoint application/x-shockwave-flash image/tiff application/x-font-ttf application/vnd.ms-opentype audio/wav application/vnd.ms-write application/font-woff application/font-woff2 application/vnd.ms-excel
<IfModule mod_mime.c>
# DEFLATE by extension
AddOutputFilter DEFLATE js css htm html xml
</IfModule>
</IfModule>
</IfModule>
<FilesMatch "\.(bmp|class|doc|docx|eot|exe|ico|json|mdb|mpp|otf|_otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|pot|pps|ppt|pptx|svg|svgz|swf|tif|tiff|ttf|ttc|_ttf|wav|wri|woff|woff2|xla|xls|xlsx|xlt|xlw|BMP|CLASS|DOC|DOCX|EOT|EXE|ICO|JSON|MDB|MPP|OTF|_OTF|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|POT|PPS|PPT|PPTX|SVG|SVGZ|SWF|TIF|TIFF|TTF|TTC|_TTF|WAV|WRI|WOFF|WOFF2|XLA|XLS|XLSX|XLT|XLW)$">
<IfModule mod_headers.c>
Header unset Last-Modified
</IfModule>
</FilesMatch>
# END W3TC Browser Cache
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress
# BEGIN SAR One Click Security
# Any decent hosting should have this set, but many don't have
ServerSignature Off
<IfModule mod_autoindex.c>
IndexIgnore *
</IfModule>
# Block access to sensitive files
<Files .htaccess>
Require all denied
</Files>
<FilesMatch "^(license\.txt|readme\.html|wp-config\.php|wp-config-sample\.php|install\.php)$">
Require all denied
</FilesMatch>
# Stops dummy bots trying to register in WordPress sites that have registration disabled
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} ^action=register$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^.*registration=disabled$ [NC]
RewriteRule (.*) - [F]
</IfModule>
# Block requests looking for timthumb.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)/?timthumb\.php$ - [F]
</IfModule>
# Block TRACE and TRACK request methods
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)$
RewriteRule (.*) - [F]
</IfModule>
# Block any query string trying to get a copy of wp-config.php file and gf_page=upload (deprecated on May 2015, update your copy of GF!).
#<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} ^.*=(.*wp-config\.php)|gf_page=upload$ [NC]
RewriteRule (.*) - [F]
</IfModule>
# END SAR One Click Security
My LAMPP index.php file
<?php
if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
$uri = 'https:/';
} else {
$uri = 'http://';
}
$uri .= $_SERVER['HTTP_HOST'];
header('Location: '.$uri.'/wordpress/index.php');
exit;
?>
Something is wrong with the XAMPP installation