Test Wordpress on Windows / IE with virtual machine - wordpress

I'm on a Mac computer, and I need to test a Wordpress website on IE / Windows. I have some VMs (Virtual Box) that can do the job, but I need the site URL to be the same as my localhost URL (as it's Wordpress configuration).
So, I read some articles and here's what I've done so far :
My conf :
localhost:8888/myproject (MAMP server)
On the Windows (VM) host file :
192.168.0.20 localhost
Assuming 192.168.0.20 is the local address of my MAMP server on my Mac. So I saved the host file, but nothing happens, IE can't find the document. When I go directly to 192.168.0.20 I can see the project without its assets (no images, css, etc.).
Any ideas ?

Well, I asked to soon : it appears that Windows just take some time to apply the changes I made in host file (about 5 minutes).
Nevermind, hope this helps anyway :)

Related

setting up a Wordpress site on XAMPP goes wrong

I currently upgraded my laptop to windows 10 and now XAMPP won't install my wordpress website.
I have read lots of questions where people had the same problem: Port 80 is already in use.
I couldn't find the services that need to be disabled, like Skype and W3SVC, IIS.
Now i wanted to try to change my port from 80 to 8080, I did this using the httpd.conf file. And tried setting it up but it still doesnt work. Even not when i set "hostname: localhost:8080", if i don't put 8080 behind it it will direct me to the page which says: "Error database connection couldn't be established". And when I do put 8080 behind it it will keep loading for ever.
Does someone have a better solution than stopping services/processes?
Thanks in advance.
Ok after searching for a long time i finally found the answer, i found it on https://superuser.com/questions/352017/pid4-using-port-80
This worked for me:
If it is a System Process—PID 4—you need to disable the HTTP.sys driver which is started on demand by another service, such as Windows Remote Management or Print Spooler on Windows 7 or 2008.
There is two ways to disable it but the first one is safer:
Go to device manager, select “show hidden devices” from menu/view, go to “Non-Plug and Play Driver”/HTTP, double click it to disable it (or set it to manual, some services depended on it).
Reboot and use netstat -nao | find ":80" to check if 80 is still used.
Launch RegEdit.
Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP
Change the value of "start" to 4, which means disabled.
Reboot your computer.
My solution was the second way

PhpStorm + WordPress Project + "502 Bad Gateway error"

I have used WordPress on Cloud9 successfully previously, but I can't even get a new one to start via JetBrains IDE.
I have two machines: one Windows (XAMPP) and one Mac (MAMP) and getting the same "502 Bad Gateway" error when the browser tries to login to the WordPress dashboard page.
I downloaded a fresh WordPress copy, set up my database and ran index.php in the WordPress root folder. That does take me through the database questionary and up to the WordPress login page, and then the browser hangs there. It tries to load something and nothing happens. If I halt the browser and refresh, I'll get the 502 error and I'll keep getting this error on ANY OTHER files that I try to run from now on (it feels like something server-related breaks from within the IDE and I have to restart it).
The PHP 7 interpreter seems to be working fine, because I don't have an issue running any other of my non-WordPress projects.
The project address is http://localhost:63342/wordpress/, but I noticed this below link is shown in the PHP-CGI server window:
/Applications/MAMP/bin/php/php7.0.0/bin/php-cgi -e -b 127.0.0.1:56502
Does this PHP CGI pointing to a different port number mean anything? I am new to WordPress and it was a breeze starting one in Cloud9, but I just don't understand why it doesn't work in PhpStorm 10.
As I said, there is the same problem on two machines (Windows, Mac, MAMP, XAMMP, and PhpStorm), so I know it is me who's missing something here.
I recommend you use Varying Vagrant Vagrants WordPress (VVV).
It's a better solution and will help you achieve better results without too much hassle.
I would recommend you to use a simple editor like Sublime Text or Atom and install packages. I have personally lost many hours trying to get PhpStorm, MAMP, LAMP, and XAMPP work the way they should.
I managed to solve my problem. It was the port number causing it to crash. My MAMP port number is 8888 (XAMPP is 80) and when I set up PhpStorm a year ago on both machines somehow I entered 63342 as server port number!
This never created any problem for me whatsoever running dozens of PHP projects since then, but obviously, it mattered to WordPress (dashboard). I went to PhpStorm settings and corrected the port number so it matches MAMP/XAMPP and all is working fine now.
It was a pretty basic (and silly) mistake to make on my part, but that wasted two full days in which I could have been teaching myself WordPress and developing themes/plugins.
Yes, it worked for me after configuring the built-in server port to 80 (I have used XAMPP)
Setting steps in phpstrom: Configure the built-in web server

How to create a link in Wordpress to a file on an local network server

I installed Wordpress on my station and its now being used internally for corporate blogging.
I wanted to know if there is a way to create links to servers in our intranet?
For example to access a server resource in windows I use Run->\server-name\folder\file.txt
How can I create a link to such file in Excel (or generally in HTML) that will be opened by Firefox & IE when clicked in Wordpress.
Thanks,
Roy
You can either map the servers to virtual hosts on the web server and create links like you would to any external file on the internet.
Or, if you insist, use
file
in your example:
file
After checking this, the right way to mimic a UNC form (at least in my case) was:
file
which is equal to
\\server-name\folder\file.txt
It works in Firefox (3.6) and IE (8).
We use Windows XP, all stations are in an Active Directory domain, in case it matters.

Wordpress + VMware CSS path problem

I posted a similar question earlier today but this question is clearer.
I want to locally develop my Wordpress websites (on my Mac) and test them in Internet Explorer (6,7,8) on Windows XP.
I can get the MAMP welcome screen to show in Windows XP, so I know VMWare is doing it's thing.
The local URL for my site (on my Mac) is:
URL (http://d3creative:8888/)
But the local URL under VMware/Internet Explorer is:
URL (http://192.168.2.1:8888/d3creative/)
This is the only way I can get it to show up, problem is all the CSS styles are referencing the local Mac URL (http://d3creative:8888/)
So understandably the CSS isn't showing up.
Is there a way to tell Windows that "http://192.168.2.1:8888/d3creative/" should equal "http://d3creative:8888/"
I've tried editing the "hosts" file within in Windows XP and I've rebooted after making any changes, but nothing is working.
My software:
MAMP Pro (v1.8.2)
Wordpress (v2.8.6)
Windows XP (SP3)
Internet Explorer (6, 7, 8)
Any help would be much appreciated.
Stephen Meehan
Thanks for everyone for taking a look at this, after much head scratching I have arrived at a solution!
Here's how I did it. hope this helps anyone else with the same problem. I'll be posting a video walk though for this at the end of next week on my website.
MAC OS
Open terminal to find your Mac IP address
type: ifconfig in terminal
Scroll down until you see "vmnet1"
Look for the word "inet" next to this is the IP address you need
Make a note of this as you will need it when you modify the "hosts" file in Windows XP
Close Terminal
VMWare:
Set network adapter to "host-only" and make sure it is connected.
Add your MAC Address in the Advanced options field
(Your Mac address can be found in the system preferences under network)
Close the window and it will ask you to apply changes, say yes.
Windows XP
Open the hosts file (c:\windows\system32\drivers\etc\hosts)
Use notepad
You should see:
127.0.0.1 localhost
Under this enter the Mac IP address you got from Terminal followed by the name of your local site - in this case the site name is "newdemo". The site is determined by the Server name you set in MAMP Pro
Your Mac IP Address newdemo
Your hosts file should now look like this:
127.0.0.1 localhost
Your Mac IP Address newdemo #change this to the Server name you set in MAMP
Command prompt (Windows)
Open command prompt (start button > run > type in CMD)
Type ipconfig/flushdns
Now when you visit http://newdemo:8888/ you will see your local site in Internet Explorer!
Good luck!
Stephen Meehan
From your description, you have the site hosted on a Mac which is also running a virtual machine with Windows on it and when you try to access your site on the Mac from Internet Explorer in the VM you get no css but do you get the css fine if you point Safari on the Mac back at itself?
I would view the source of the Wordpress page in IE and check that the url for the css file is relative to the root of the website and not pointing directly at a filename in the OSX directory tree.
But without knowing what is actually in the rendered source code in the browser, it seems hard to think of what the problem might be.
The hosts file is certainly the first way to go (and should work for translating the host name into the IP no problem) but the problem in your case is that you need to serve different directory levels. Why is that in the first place? It can certainly be solved with mod_rewrite but it's awfully cumbersome.
Can't you address the whole site with http://d3creative? Won't that solve the hierarchy problem?
Im not much of a techie, but cant you just use wamp on the xp side?
http://www.wampserver.com/
You're going the wrong way with the hosts file -- instead of trying to get your browser to treat 192.168.2.1 as d3creative, putting the entry in your hosts file will allow the machine to resolve d3creative -- visit http://d3creative in your Windows browser.
HTTP works by first resolving the host name to an IP address, if required, then by passing the host name (or IP address, if no host name was given) when it connects to that IP address. The hosts file looks after extra mappings between names and IP addresses, it doesn't have anything to do with what the browser will pass to the server once the connection has been made, while the server will decide which locally-hosted site to return based on what the browser tells it after the connection has been made.

Not able to run ASP.NET web app using Development Server

My development machine (Vista) was working perfectly fine for over a year and then suddenly (without explicitly installing anything) I am unable to run the websites using ASP.NET development server.
The development web server starts fine, but IE cannot display the page:
Internet Explorer cannot display the
webpage
Firefox says - Failed to
Connect, The connection was refused
when attempting to contact
localhost:49447.
Here is what I have tried so far:
Disabling firewall
Stopping anti-virus
Stopping Windows Defender
It worked when I stopped all services using MSConfig and tried again.
However, that disables most of the services, so is not a feasible long term solution.
After stopping all services, I tried starting services one by one to find out which one is causing problem.
These are the steps and results:
I found DNS Client Service was
causing problem.
So I started all others and
stopped DNS Client service, but then
Network Location Awareness service
started causing problem
I stopped DNS Client Service and
Network Location Awareness and
started all others, btu again
something else is causing problem.
Clearly there is something common and fundamental at the root of this.
I do not know much about networking. Can someone guide me in right direction?
Note: I have found another person who
is having same problems since this
morning. Looks like it could be
related to one fo the windows updates!
Is anyone else getting affected like
me?
I was able to fix this on my computer by doing the following:
My host file contained this line for the localhost entry, which is how the host file ships with Vista, and i've never modified this line
::1 localhost
Replaced "::1 localhost" with the this:
127.0.0.1 localhost
"::1 localhost" has worked fine for me for well over a year, until this morning. Windows defender installed two updates, one yesterday and one this morning, my guess is that something in one of these updates caused this entry to not work anymore.
I have solved this problem.
The problem comes because somehow the entry in host file is removed for localhost.
you have to add entry in host file which is kept in System32/etc folder.
just add this at the end of the file.
127.0.0.1 localhost.
save this file and try to ping localhost from cmd prompt.
i think this will resolve your problem.
now try running you website.
All the best.............
If stopping all the services made it owrk, try stopping one at a time. Eventually you will find out which one it is.
Hopefully someone will know which it is from experience, but if not you can find it yourself.
Sounds like you have a proxy server issue - have you checked this out?
KB886388 - You may receive a "Failure to connect to Web server" error message when you browse local Web applications
I also started to get this problem tonight, think I installed a windows update package yesterday.
I'm running VS 2008 (9.0.30729.1 SP) and Vista Ultimate SP1 (32-bit).
Replacing localhost with 127.0.0.1 worked for me.
http://localhost:49227/testsite/Default.aspx
http://127.0.0.1:49227/testsite/Default.aspx
I'm having the same problem. Was working on my website last night, one minute the site worked in the broswers next minute it could not connect to the localhost.
Replacing localhost to 127.0.0.1 worked for me. I'm still inexperienced in asp.net, is there a file where you change
http://localhost:49227/testsite/Default.aspx to
http://127.0.0.1:49227/testsite/Default.aspx
As I am just changing the url in the browsers
This one also worked for me. What I did was:
Go to the Property Page of my Project.
Then under Start Options, look for the Server, instead of 'Use default Web Server', i changed it to 'Use Custom Server'.
Typed the http://127.0.0.1:49227/MyProject/ in the Base Url.
That's it. It automatically opens the site using this link.
Same problem here using visual studio 2008 express
Changed "localhost" to "127.0.0.1" and the page came up.
This problem seems to have an effect on internet explorer and firefox
Opera hasn't seen this problem :-)
Grtz
Changing "localhost" to "127.0.0.1" worked well for me, as well.
but just to clarify the whom are not familiar with vista here are the guidelines to change:
Browse to Start -> All Programs -> Accessories
Right click "Notepad" and select "Run as administrator"
Click "Continue" on the UAC prompt
Click File -> Open
Browse to "C:\Windows\System32\Drivers\etc"
Change the file filter drop down box from "Text Documents (.txt)" to "All Files (.*)"
Select "hosts" and click "Open"
Make the needed changes and close Notepad. Save when prompted.
The problem comes because somehow the entry in host file is removed for localhost.
you have to add entry in host file which is kept in System32/etc folder.
just add this at the end of the file.
127.0.0.1 localhost.
save this file and try to ping localhost from cmd prompt.

Resources