Symfony local web server with domain proxy inconsistent behavior - php

I cannot seem to get consistent results with the Symfony local webserver using custom domains.
I initially set the proxy up according to the documentation here and it initially worked quite well. However on subsequent returns to working on the project it will most of the time fail to work, and I cannot seem to find the right sequence of steps to take in order to make the local server work with the proxy domains.
I understand that others have had issues with Chrome proxy settings and I've followed the steps to omit that to no avail.
I am running Symfony 5.3.7 for this project, locally on MacOS Big Sur 11.6. This morning returning to the project I have tried the following to no avail...
Stop and restart the proxy symfony proxy:stop & symfony proxy:start
Stop and restart the local server: symfony server:stop & symfony server:start -d
Flush the MacOS DNS cache
Clear the Chrome DNS cache
Remove bad proxies from Chrome
Reapply proxy settings in Chrome
Verified that the proxy PAC file is in place in the networks settings
Verified that automatic proxy configuration is checked in the network settings
Cleared all browsing data in Chrome
Restarted Chrome
I have tried various combinations of all these steps.
I've removed and reattached the proxy domains with the Symfony CLI.
I've tried other browsers including Safari and Firefox.
When I start the server, I can see that the domains are attached, or when I navigate to http://localhost:7080 I can see they are attached and 'running'.
When I visit the local domains I get the following error:
This site can’t be reached
Check if there is a typo in (domain).wip.
DNS_PROBE_FINISHED_NXDOMAIN
The only way I can visit the local site is thru the local host IP and the port that is assigned when I start the Symfony Server.

Try to open your website in incognito mode (so that all plugins get disabled). For me, I had a plugin for TunnelBear VPN. After I disabled the plugin, it started to work.

Related

Atom PHP Live Preview

I would like to achieve the impossible! After much research I simply can not get a live preview of a basic PHP website to work in my environment.
I have Windows 7/10 development machines and the first goal is to be able to make changes to PHP / CSS / SCSS files and see the changes appear automatically, on saving a document - without having to refresh the browser manually.
I'm using Atom v1.5, Wampserver v3.0.6 and have tried almost everything....LiveReLoad, BrowserSync etc etc.
The current setup works apart from live preview, in that I can display the websites and even go to different machines on the LAN and get to the website....but if I try and install Atom packages and or Chrome browser extensions, I generally get absolutely no response (i.e. no error message.)
Many thanks for anyone who can help with this - it surely must be a basic requirement for any professional developer?
Even though I've only just asked this question - I'd been working on it all day....however I have finally found a combination of tools and settings that worked!
The solution I found is:
Install Atom Live Server
Install Chrome Live Web Server Extension
Set the "Actual Server Address" in the Chrome Extension to whatever you have set in your Wampserver Alias - your httpd-hosts.conf file
Set the "Live Server Address" to your localhost + the port number gained from starting Atom Live Server: something like "http://127.0.0.1:4769"
Allow these requests through your firewalls on all applicable machines.
Note that Atom Live Server starts with a different port every time - so use the built in options to start on a fixed port, so that you don't have to keep changing the settings in the Chrome extension.
E.G. In Atom editor, ctrl-alt-5 to start it on port 5000

Cakephp and iOS 10.3.2

Since the new iOS update (10.3.2), we can't reach our website from an Apple device. Safari, Chrome or Firefox are returning a blank page or an error page saying there's a network problem.
We've tried from different places, different kind of iphones, on wifi or cell connection (3G,4G)
On mine it was working well, so I updated it to the 10.3.2 version, and I'm having the same error.
I tried contacting my web host but they told me they couldn't do anything. I tried to install Cakephp in a subdirectory, but even with a fresh install and an empty cakephp (2.9.8), it doesn't work.
I tried the same thing with a Cakephp 3 installation, and it works.
I tried installing Cakephp 2.9.8 on another web hosting (a personal one from the same web host) and .. it works.
So I'm getting a little confused as it seems to be an issue with :
iOS 10.3.2
Cakephp 2.9.2 to 2.9.8
my web hosting
Does anybody can give me any direction to look up ? I'm starting to be really depressed here ...
I found a temporary solution by changing my web hosting configuration.
My web host (OVH, French host) allows to use PHP-FPM (which is a PHP FastCGI implementation) to enhance the website performance.
When I disabled it yesterday, my website was available for iOS 10.3.2 users ! I don't know why, but for now I'm relieved.
I've just asked OVH if they have any idea why, but I'm not really optimistic about their reply ...

How to Xdebug multiple sites hosted on my local machine that make requests to each other (in PhpStorm)?

I'm attempting to get Xdebug working with PhpStorm on multiple sites. Say I have 2 sites both being served in the same vagrant VM on my local machine:
http://my-app.dev (makes requests to the API below, xdebug is working)
http://my-rest-api.dev (receives requests, but xdebug is not working)
My App makes requests to my rest API. When I visit http://my-app.dev in my browser, Xdebug is working correctly in PhpStorm for that project. I'll also have the API project open in PhpStorm as well. When I set breakpoints in the API project they are never hit (even though my App is successfully making requests to this API). The only way I can get the breakpoints to work in the API is if I open a browser tab and type in the API's endpoints directly into the address bar. I know there are extensions I can use to test API endpoints, but this is not convenient at all, since the requests would be cumbersome to build manually each time.
Both projects are set in PhpStorm to listen to PHP debug connections. I also tried turning on xdebug.remote_autostart = 1 in my xdebug.ini file on the VM server. I've also set Max. simultaneous connections to 10 in PhpStorm Debug preferences.
Any solution on how I can debug both these sites together? I think this is a question that would help a lot of developers.

Website is not loading in chrome and firefox

My magento website is not loading in chrome and firefox.It works fine in IE only. I cleared the chrome cache and history but it not display my website it shows like "This webpage is not available ERR_SSL_VERSION_OR_CIPHER_MISMATCH ". How to solve this error i am working on this issue for last 2 days.
That's nothing to do with your website as such, that's a server configuration issue.
Most likely your server is still trying to serve https requests using SSL3, which has been removed in Chrome 40 (and I guess firefox as well, but I don't have the changelogs to hand to check)
This is a good tool to check your SSL settings:
https://www.ssllabs.com/ssltest/
This will confirm any issues, and advise on fixes.
If you don't have full server access, then you'll need to speak to your host.

Cannot Get Laravel Welcome Page to Show

My server is on DigitalOcean cloud. I am using Ubuntu with Apache web server. My home computer is running Windows 7. I am using putty for terminal.
Followed all of the directions on https://laracasts.com/series/laravel-5-fundamentals/episodes/1. Made it up to 8:40, where it directs you to run php -S localhost:8888 -t public. I run that, then open a web browser and tried the following:
-http://mywebsite.com:8888
-http://www.mywebsite.com:8888
-http://mywebsite.com/learning-laravel-5/public
-http://mywebsite.com/learning-laravel-5/public/index.php
None of the above work.
In Google Chrome, the first two options where I list the port number, I get a page saying This webpage is not available. ERR_CONNECTION_REFUSED. In IE, I just get a page with big font saying "This page can't be displayed."
For the last two options, I just get a completely blank page. In the console, I get this error: Failed to load resource: the server responded with a status of 500 (Internal Server Error).
I'm trying to pick up a web app framework to broaden my php skill set. Can someone help me out? What am I doing wrong/what is the video tutorial missing that I have to do in order to get Laravel up and running?
php -S localhost:8888 -t public is meant for running a site locally, which is what the video is showing.
If you are using a Digital Ocean droplet with Ubuntu and Apache, you will need to configure Apache to use /public as the document root and have Laravel installed in the /var/www directory.
From there you can visit the droplet's IP address (http://XXX.XXX.XXX.XXX) instead of the domain name (unless you have configured the DNS for that domain name). You won't need the port in the URL either, since Apache will be serving it on the default port 80.
This probably is not the answer you want, but here's my advice based on setting up a few VPSs on Digital Ocean. Step back. Spin a new VPS. Keep your old one around, if you want, but start afresh.
Create a new droplet
Setup your SSH and PuTTY and make sure that works
Setup your FTP (if you're using it)
Setup your DNS
Setup your Apache config files. DO has a very good tutorial on this: https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-14-04
Now, work on getting your "Hello world" html page to show when you access your domain www.yourdomain.com, yourdomian.com. Don't fixate on ports at this point, just get a minimal server running. This might help too: https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts
Make an saved "image" of this basic working setup so you can spin a new VPS if you need to.
Now that you have a server that loads your domain index page, you can start to install your Laravel.
In a nutshell, I'd advise you to establish a stable working server platform before you try to install and launch a more complex technology like Laravel, or Rails, etc.
Tutorials often make complex technologies seem easy, the 10-minute expert, but there is tremendous complexity masked under the hood of these frameworks. Start simple and build on a server one piece at a time. You have to walk before you run.
I use Laravel often, but my experience with servers is more relevant here. Everything you've said indicates an access problem, and knowing how hosting companies work, they probably have that port blocked (along with all other non-standard ports).
You can test this using PuTTY, open it up and enter the host name of your server. Change the port to 80 and change close on window exit to never, then connect. Enter:
GET / HTTP/1.1
Host: yourwebsite.com
Then press enter twice and the server will process the result. It should show you the HTML of your home page.
Now try it again with port 8888 and see if you can even connect. If you can connect then it's not a port issue, but my guess is you'll get a fatal error Network error: Connection refused, which means the port is closed or blocked via firewall.
Even though DigitalOcean give you complete control over the server, the connection probably still runs through their firewall. It's possible that you have your own firewall, but otherwise if the server runs through their firewall and the port is blocked nothing you can do on the server will open that port.
did you try chmod -R 0777 storage ?

Categories