net:err_connection_reset after loading php file completely - php

I have a quite simple php page (PHP 5.5.35 on CentOS 5.11) that queries a MySQL database. The resulting page shows completely, including the footer I include as a final instruction, so the PHP script runs entirely without error.
Almost every images and js libraries are loaded. However, there are two elements that are never loaded, an image and a jquery library. Each time and with any browser, those elements generate a (in Chrome, for instance) :
Failed to load ressource : net::ERR_CONNECTION_RESET
For testing purpose, I tried to delete those element from the page, ultimately, it is the favicon that can't be loaded. So it seems not to be those elements in particular. The connection seems to be reseted at some point between the PHP script completion and the page loading… and I don't have the beginning of any clue where I should start the troubleshoot.
Some other informations :
Apache logs don't log anything !
The other pages of the site works well
The site works without any problem on my local machine (Mac OS X, PHP 5.5.35 too)
Once the page is loaded, if I click any link on it, it shows a "Connection reseted" error page.
Does anybody have a clue, anything about where to start my search ? Thanks in advance, I am starting to desperate.

It happened that after searching everywhere, the cause was simply that I was handling a lot of parameters through GET – too many of them. I changed the code for using POST and everything worked miraculously… Hope it may help someone, sometime !

Related

What causes Website timeout when it is working flawlessly with vpn?

I have some php (php 7.4) program that is connected to a Webserver that causes problems when I do not use a VPN.
Sadly, we just using the server without any rights to config it.
So if you need something specific I can ask for this Information.
There are some Serverinformations
DB-Server
Server-Type: MariaDB
Server-Version: 10.4.20 MariaDB - MariaDB Server
Webserver
Apache/2.4.37(centos)
PHP-Ext: mysqli, curl, mbstring
PHP-Version: 7.3.20
phpinfo():
PHP 7.4.18
Other People testing the program getting same results.
My php program is working flawlessly with VPN and local.
Now here is the issue:
It is some straight-forward program. You need to answer the questions to get further and after some time you can end the program. A Survey, you can start it by typing the URL in any Browser you find.
#Thats bringing me to this point#
Program interrupts randomly (no specific site or element) while work through. Leaving TimeOut Website and deprecated non-js Modules console-message. Apparently things are deprecated.
#Now I use VPN#
Program does not interrupt at any point. This procedure is working for every Person testing the Program. This means, I do not get the message "deprecated non-js modules".
Either things are not deprecated or there are other reasons making the Program work without timeout.
Error-Code
Website
ERR_CONNECTION_TIMED_OUT
Console of Chrome
VM9:7146 crbug/1173575, non-JS module files deprecated.
My Doings and Ideas:
I checked the whole Program for deprecated elements, tags, functions...
-> Using PHPStorm and:
ini_set('display_errors', 1)
ini_set('display_startup_errors', 1)
error_reporting(E_ALL)
-> There were something. Every used deprecated something could be replaced easily. Lucky me.
IP-Adress is stable while working through the program.
Program is working local. Tested it 50 times without any interruptions.
Program is working with VPN. Tested it...
Session variables expire after 6 hours.
classic mysqli_connect.
session cookies.
using css and js files.
using other php files for configs and better organisation.
####New Facts
I tested some other php program (more complex - needed to add "preventDefault()" to make it work for Chrome/Safari). Using same files and every function of the contaminated php program. And no timeouts without VPN.
-> Now I think it is the specific program. But why? There is nothing new in use.
Differences:
The corrupted program shows some text and answer options you need to click to get to the next site. Website timeouts occur randomly when I press the radio button to send the value.
New program shows also some text and these answer options. But you can interact with it. After you press the radio button, you get pictures and buttons which are telling you what to do. I added a simple event handler (js) to show these pictures and buttons and hide em (depends on the condition the program gives you). It is using the same functions to send values, present pictures/texts, hop to the next page. It has generally more pages, therefore more texts, pictures.
The VPN I use must be very close to the server. But cannot tell for sure. It is something like an university-vpn to access specific things.
Tested it with handy-network (5G). No timeouts! I asked people to test it, so we get some stability-statistics.
It is important that people (not only me) outside this vpn-network can access the program and end it successfully!
Can you show me some lead I can follow?
Thank you. :)
I solved my problem, contacting the server-support.
Firewall rules are very strict and blacklisted people who are testing the program with >1 click per second. Apparently that is the behavior of a bot.
That explains also the working other php-program, which uses same functions, files, everything. There, you couldn't be faster than 1 click per second because you need to wait for some elements to show you what to do before sending produced values.
Special thanks to ADyson! :)

Error "loading" the phpMyAdmin environment in my browser

I'm having trouble logging into my phpMyAdmin server database.
Here's an album with a few pictures of the error I'm getting. http://imgur.com/a/XhTj3
Whenever I open phpMyAdmin in my browser I get the first picture, the normal login screen but with a login section for the sidebar, and the main content. I have to log into each separately (as shown on the second/third picture), and when I do the environment looks completely different, like it isn't styled at all and just html/php. Normally when I log in it looks like the normal phpMyAdmin environment like in the pictures on this tutorial https://www.siteground.com/tutorials/phpmyadmin/phpmyadmin_administration.htm
I've been using this database for a few months now and never had this problem. It was working last friday, but just started doing this this week.
I've looked around on the internet but I can't find anything helpful, I'm a bit of a noobie too when it comes to php and databases. Thanks for any help in advance!
Edit: I've tried uninstalling / reinstalling phpmyadmin on my server and now I'm getting the following error "Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.". If I refresh the page I go back to the duel-login page as before

Browser compatibility issues with PHP website

I have a website called www.kratosguide.com.
The site works as expected for approximately 90% of users, however, I have been getting a LOT of complaints recently that the page doesn't load completely in certain browsers such as chrome/firefox/opera.
Here is a screenshot that someone sent me of how the page loads: http://i.imgur.com/sqNX4.jpg
It appears that only the header and footer is loading and the content from index.php is not.
http://www.reddit.com/r/productivity/comments/w1y30/16_habits_you_should_do_everyday/
Here is a link that demonstrates a user stating the issue above -- (4th comment down).
My host is unable to replicate the issue on their end and they say it works fine. My friend kept refreshing his page cache and he could replicate the error but only intermittently.
Thanks in advance.
***EDIT: I forgot to mention the site runs on WordPress, also the site works fine for me in every browser, which makes it hard for me to see where the problem is coming from.
Check the console. You have some errors
Uncaught ReferenceError: jQuery is not defined - 068690ea.84e407.js:24
Probably caused by this script being called before the jquery library.
It's difficult to tell what is causing the error without being able to replicate it. I'd try to load it in various browsers and see if I can get it to do that. Then take a look at the console for any errors and inspect the DOM to see if the content even loads.
Yes, I still see the errors in the log.
Let me be clearer.
For me the web page loads and is visible 100%, but when I look at the console I see what is shown below. This is an indication you have a problem. My personal settings allow me to see the page but with different settings or plugins I would not be able to see the page. You need to fix your XSS error.
You can reproduce the problem yourself!
Download chrome (or firefox) and then load the page, look at the console, see the error.
Then fix it.
Original answer below
First step, fix these errors shown by chrome. Looks like you have a XSS error.
I saw over 1200 unused CSS element on your page. Try to optimize the amount of data a user has to download to see your website. I had similar issues with my site and I realized how much stuff users had to load to see my website.
I tested it under Firefox, Chrome, IE7+. I didn't get any issues.
You seems to be using WordPress so you might want to check the WordPress community for similar problem.

PHP error, no data received

I keep getting this error:
No data received
Unable to load the webpage because the server sent no data.
Here are some suggestions:
Reload this webpage later.
Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.
I know it's part of my script, but I don't know which part. It divides certain text into a few different files, and those files are being created, but it's also supposed to zip them, but it's not getting to that part, so I have a vague idea of the general area the problem is occurring. I know this entire question is lacking detail, but I'm hoping that someone who has more experience with PHP and who may have seen the error before would be able to tell me what's happening.
http://gyazo.com/12ba55613011a115bb7507040f4d3ddf
EDIT: It works on Firefox... How can it be different between browsers if it's server-side script?
Restart apache and mysql
service httpd restart
service mysqld restart
Hopefully this answer helps someone.
It's a Chrome thing: http://www.google.com/support/forum/p/Chrome/thread?tid=7d50c093bd4f8f6c&hl=en
I don't know if you've already solved this, if it's a different problem causing the same symptoms or whatever, but yesterday I noticed this same error on my development machine, running Apache+PHP+MySQL under Linux, when accessing my local phpMyAdmin:
http://localhost/phpMyAdmin
It was running fine until that day, and I realized that by the same time I changed some settings related to sessions in my php.ini.
The problem was caused by having session.save_handler set to user instead of files. So I switched back to
session.save_handler = files
and voilà... everything is working fine again.
Also be sure to have set the proper session.save_path. In my case, and probably in most Linux systems,
session.save_path = "/tmp"
Be sure to set the proper permissions to that directory, too. Mine is chmod'ed to 777.
A little late to the draw here, but I received this error while working on a local copy of a php project (on Chrome), and although Firefox loaded some parts of the pages, it was still throwing similar errors.
The really weird part was that if I commented out includes or a few functions it would load partially.
I got around it by restarting the local server. I was using MAMP. You can tell for sure that this is the issue if you're running MAMP by going to the home page - it'll likely throw the same error.
tail -f /opt/local/apache2/logs/error_log
(or wherever is your apache2 install..)
... Will likely help you to spot where the problem lies in your PHP script. At least it did for me when facing the same problem (No data received, whatever the browser).
I was getting this issue intermittently in Chrome. For me, reloading the page would get a successful (non-empty) response, but it would sometimes take up to 3 or 4 reloads of the page. To handle this, I added the $.when(), .done(), and .fail() jQuery functions to my AJAX request. If the request fell into the .fail() function, I ran the location.reload(); js command to get the page to reload. Otherwise, I called a function that did the rest of my page loading in the .done() function.
This has the potential to create an infinite loop with the page never receiving a successful AJAX response and continuing to reload forever. So only try out this method if this issue is intermittent. If you are unable to get a successful AJAX response at all, then this method will not work for you.

PHP stops rendering page somewhat arbitrarily

I've spent all morning trying to find an answer to this, to no avail. I'm working on a website, and I set up a small test server to make changes on. When I loaded the page I had made a few changes to, I noticed that the page stopped short. I reloaded the page, and it stopped at a different place. I reloaded again and again, and noticed three or four places that it stopped at, but couldn't predict where it would stop. The page itself is included from the page with the logic in it, is included when the page isn't POSTed to. I made a small page page containing only a phpinfo();, and the same problem exists as well. It stops at seemingly random places in the tables produced.
Has anyone else ever had this problem, and if so, how did you get rid of it?
Setup:
Windows XP (Test Server)
XAMPP
PHP 5.2.9
Apache 2.2.11
The only change I made to the server was pointing the document root at a different folder in the httpd.conf file.
Most likely, your script is running out of
1) Memory
2) Max execution time
Check those constants in php.ini
I'd check the apache and php server logs.
If you have it crash on you when only calling phpinfo() and nothing else, then it most likely is somekind of conflict (not your code).
Post your logs here if you need more help.

Categories