wordpress virtual host
Posted by: abdul1 (---.arts.ac.uk)
Date: July 11, 2019 07:06PM

I installed wamp 3.1.9 on windows 10, I setup a local and virtualhost with a wordpress install and it all worked fine. I then tried to copy a hosted site to my wamp virtual host which again was fine but when I moved the database I got an error.

So I uninstalled wamp, removed all traces of it and reinstalled it, I installed wordpress on localhost which worked but it is not working on virtual host. Like I say, it all worked fine on the first install but in the second install, when I launch the virtual host I get ' error establishing database connection'.

Any ideas, I have gone through a number of scenarios and can not get wordpress to install on the virtual host.

Options: ReplyQuote
Re: wordpress virtual host
Posted by: RiggsFolly (Moderator)
Date: July 11, 2019 07:30PM

Hi

We are not clairvoyant!

... I moved the database I got an error WHAT ERROR

So I uninstalled wamp WHY

get ' error establishing database connection'. ...Did you amend the wp database parameter file?


Did you read The Wordpress site on moving a wordpress site?

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.9 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.16>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 1 time(s). Last edit at 07/11/2019 07:32PM by RiggsFolly.

Options: ReplyQuote
Re: wordpress virtual host
Posted by: abdul1 (2.26.107.---)
Date: July 12, 2019 12:12AM

I have a working WordPress site hosted on an external server but I want to test some of the plugins so I want to host it locally in my PC.

1- installed wamp server then installed WordPress on localhost and on virtual host.
2- Backed up the database on hosted site using wp-db plug-in, have followed the guides, changed the php.config file parameters to have the database prefixes to match.
3- copied the new php.config file to wamp virtual host director and when I update the site page I get ‘error establishing database connection’.
4- Removed the wordpress install from the virtual host directory (including php.config file) and deleted database from MySQL.
5.-Copied a new copy of the WordPress files back to virtual host directory and created a new database with php my admin.
6-Launch virtual host and I get ‘error establishing database connection’,
7- Uninstalled wamp because I kept getting the, ‘error establishing database connection’, only on the virtual host.
8- reinstalled wamp server, created new virtual host and copied new set of WordPress files.
9- created new database using php my admin.
10- launch virtual host url and again get ‘error establishing database connection’, WordPress doesn’t go through the install and does not create the php.config file. I have done this about 4 times and continually get the error establishing database connection.

However the install of WordPress works fine if I do it as local host, just virtual host is not working.
So I know that the process of installing WordPress is correct because it works under localhost. Why can’t I install WordPress with he virtual host when it works fine the first time.

Options: ReplyQuote
Re: wordpress virtual host
Posted by: RiggsFolly (Moderator)
Date: July 12, 2019 01:50AM

Did you read The Wordpress documntation on how to successfully move a wordpress site?

Did you change wp-config.php to point to your local database?

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.9 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.16>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 1 time(s). Last edit at 07/12/2019 01:52AM by RiggsFolly.

Options: ReplyQuote
Re: wordpress virtual host
Posted by: abdul1 (2.26.107.---)
Date: July 12, 2019 10:04AM

Yes I read the document and I have explained the process above, however the issue is no longer about moving wordpress, it’s about WordPress not installing on the virtual host.

As I say, I have completely removed wamp and word press and reinstalled several times. Initially WordPress installed fine in the virtual host but now doesn’t .

Every time I try to access WordPress to begin the installation I get, ‘error unable to establish database connection’, this only happens with the virtual host, works fine on localhost.

Options: ReplyQuote
Re: wordpress virtual host
Posted by: RiggsFolly (Moderator)
Date: July 12, 2019 10:23AM

Here's the problem,

When done correctly, you can have as many WordPress sites as you can imagine running in the same number of VirtualHosts. So the issue must be that you have done something incorrectly.

Repeatedly installing and uninstalling WAMPServer is a waste of time.

If you get ‘error unable to establish database connection’ then something is wrong with the WP Config.


Also note we support WAMPServer! We do not provide training for each and every php based tool, library, framework or CMS.


But that said lets start at the begining!

1. lets see your httpd-vhosts.conf file, after you have created a Virtual Host into which you can try and install a WordPress instance.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.9 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.16>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: wordpress virtual host
Posted by: abdul1 (---.arts.ac.uk)
Date: July 15, 2019 12:39PM

Hello,

Thank you for offering to help and sorry for the delay in responding, here is the vhost.conf data:

# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>


#
<VirtualHost *:80>
ServerName slit.test
DocumentRoot "c:/users/bhope/desktop/slitdev"
<Directory "c:/users/bhope/desktop/shortdev/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

Options: ReplyQuote
Re: wordpress virtual host
Posted by: RiggsFolly (Moderator)
Date: July 15, 2019 01:37PM

See

DocumentRoot "c:/users/bhope/desktop/slitdev"
IS NOT THE SAME AS
<Directory "c:/users/bhope/desktop/shortdev/">

slipdev !== shortdev

Which one is wrong

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.9 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.16>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: wordpress virtual host
Posted by: abdul1 (---.arts.ac.uk)
Date: July 15, 2019 02:16PM

I edited the path to the directory (obviously included a typo because of my dyslexia) , I have copied the vhost.conf file verbatim below,



# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>


#
<VirtualHost *:80>
ServerName shortlit.test
DocumentRoot "c:/users/amohammed/desktop/shortdev"
<Directory "c:/users/amohammed/desktop/shortdev/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>


Thank you

Options: ReplyQuote
Re: wordpress virtual host
Posted by: RiggsFolly (Moderator)
Date: July 15, 2019 06:17PM

Ok, can you now show us the wp_config.php

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.9 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.16>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: wordpress virtual host
Posted by: abdul1 (---.arts.ac.uk)
Date: July 15, 2019 06:40PM

Problem is that, wp_config.php is created when wordpress is installed which I can not do because as soon as I hit the url to point to the virtual host, I get ‘error unable to establish database connection’, I can not run the wordpress install process. I have downloaded a clean copy of WP and run resolved the URL, I get the same problem every time.


I wonder if it is to do with network ports being blocked?

Thank you

Options: ReplyQuote
Re: wordpress virtual host
Posted by: abdul1 (---.arts.ac.uk)
Date: July 15, 2019 06:48PM

I have ched through resource manager if the port are restricted and it shows that they are not, so seems that mysql is fine.

Thanks

Options: ReplyQuote
Re: wordpress virtual host
Posted by: abdul1 (---.arts.ac.uk)
Date: July 16, 2019 01:47PM

I have completely removed WAMP and Wordpress, have downloaded a new copy, set everything up again as before and I get the same problem, 'error unable to establish database connection’, can anyone offer any suggestions please?

Options: ReplyQuote
Re: wordpress virtual host
Posted by: RiggsFolly (Moderator)
Date: July 16, 2019 02:43PM

Small Point The fact that you do not appear to know how to install WordPress does not actually fall into the remit of this site.

HOWEVER:

Remind me please, was this happening on the site where you made a New Install of WordPress or the site you copied from another place?

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.9 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.16>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 3 time(s). Last edit at 07/16/2019 03:03PM by RiggsFolly.

Options: ReplyQuote
Re: wordpress virtual host
Posted by: abdul1 (---.arts.ac.uk)
Date: July 16, 2019 05:39PM

I have resolved the problem,

1- I made an install on localhost
2- Copied the wp_config,php file into the directory of my virtual host
3- Created a new database with phpmyadmin
4- Edited the wp_config.php file to point to the new database
5- Reloaded the the browser and the installation process began

The problem was that running a site under virtual host you can not install WP as you would normally.

Thanks for your help

Options: ReplyQuote
Re: wordpress virtual host
Posted by: RiggsFolly (Moderator)
Date: July 16, 2019 09:32PM

So in short, you followed the standard Documented methid of installing WordPress site smiling smiley FINALLY

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.9 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.16>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: wordpress virtual host
Posted by: abdul1 (2.26.107.---)
Date: July 16, 2019 09:58PM

Not quite, your missing the point but thanks for the help.

Options: ReplyQuote


Sorry, only registered users may post in this forum.