PhpStorm + WordPress Project + "502 Bad Gateway error" - wordpress

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

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

deploying meteor on my own server

I want to deploy my meteor app on my Ubuntu server, I used meteor.sh https://github.com/netmute/meteor.sh
and everything went successfully, But i simply can't launch my app from the browser.
I'm putting my ip address and getting a 404 The requested URL / was not found on this server.
I have apache2 running, and i removed its redirection to 8080 (i used it to tomcat before)
Thanks.
(the reason i didn't use meteoric.sh is because i don't have my source code on git)
Which port are you using? It seems a proper export PATH=nnnn; is missing... or maybe you are not including the port number in your browser's address bar, like http://example.com:1234 for port 1234.
I am in a similar adventure of yours, and I've just posted the results of my experience here!
I didn't use meteor.sh nor meteoric.sh, but ended up following their path...

Dreamweaver CS6 Site Setup for Test Site with MAMP and WordPress NIGHTMARE

I have been trying to set-up a test site server on Dreamweaver CS6 IDE (which I hate) to try out the Dynamically-related files theming feature. I have been attempting to do this for hours and looked at more tutorials and blogs than I can remember attempting to set-up a test site so that I can simply try out this feature but nothing seems to work.
On the Site box I have:
Site Name: test site
Local Site Folder: users/myname/Sites/wordpress/
On the Servers I have:
Server Name: Apache
Connect using: Local/Network
Server Folder: users/myname/Sites/wordpress/
Web URL: http://localhost:80/wordpress/
Advanced:
Server Model: PHP MySQL
Yet I am receiving the an Error message:
Dynamically-related files could not be resolved because the site
definition is not correct for this server
Which makes no sense to me. Can anyone explain what am I doing wrong?
"i was under the impression that this feature would somehow convert PHP syntax into HTML so that it can be easily edited..."
What in God's name gave you that impression? PHP is server-side scripting; a way for the browser to communicate with the server and database and HTML is a way for the browser to communicate with the client (you) and render things in a form which is usable by humans. There is no "conversion", as they are two universally different languages, each serving unique functions.
In order to "easily edit" PHP, the only solution is to learn PHP scripting and syntax.
MAMP's sole purpose is to install an Apache server, PHP, and mySQL on your local computer for a server-side/database framework, such as WordPress, to store information and communicate with. Essentially like creating a mini web-host on your local machine, allowing you to check the functionality of PHP based applications.
These setting are working for me:
Open the Dreamweaver Site Setup window
Select "Servers"
Server Name: localhost
Connect Using: Local/Network
Server Folder: MAMP/ /Applications/MAMP/htdocs/your_directory_name/
Web URL: http://localhost:8888/your_directory_folder/
For a full explanation: http://www.adobe.com/devnet/dreamweaver/articles/setup_php.html#articlecontentAdobe_numberedheader_2
I have come across the same issue and found this thread.
The post that explains a bit what we want to hear is post #6 by David_Powers on 01-May-2010 at 05:31.
So to make the problem go away you can go to 'Edit -> Preferences' and disable 'Discover Dynamically-Related Files' while leaving 'Enable Related Files' activated.
Although this fixes the error display I don't quite understand what David_Powers says this function will do and if I actually want it turned on. If someone could help me realize what this option does I would appreciate it.
I don't know if this is relevant, but after many tries to figure out the Server not found error, I stumbled across MAMP Preferences on the start up page.
After clicking on Preferences, I noticed that the Document Root was pointing to username/Sites instead of MAMP/htdocs.
MAMP Preferences > Document Root > browse to select
After I set the Document Root folder to htdocs, I finally got Dreamweaver CS6 to display my php file when I clicked the Live button in split screen mode.
None of the other answers I searched mentioned setting MAMP preferences to the Document Root folder. I hope this helps.

XAMPP wordpress on localhost

I have this site and I need to test it out locally to see if there is an issue with my php settings, anyways I tried to navigate to localhost with the port number localhost:portnumber
and that worked fine, but then I tried to navigate to my site localhost:portnumber/mysite and I get a 404 error and the in the the address i navigate to changes to localhost:portnumber/mysite
Why is this happening and what can I do to fix it?
Thanks
Because you are getting a 404 error, your server seems to be running but make sure the server is the one you have setup.
1st, have you tried using a simple html file? example: blabla.html on root, and typing: localhost:portnumber/blabla.html
If this is working, that means your server is running fine, you can also try with an Hello world php file if you wish.
In the case of wordpress, there is sometime a .htaccess file that uses url rewrite and it may remove your port number, you could try to test with a clean wordpress install first.

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