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.
Related
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! :)
DESCRIPTION: I have a normal HTML website (say, https://example.com) and it has been hosted on Hostinger. Last week, I purchased a PHP script from CodeCanyon. I had put this application on this URL https://example.com/VideoDownloader. The website is running perfectly, but, I'm facing problem with this PHP script.
For the first time, if you visit this URL, it'll redirect you to install.php page. Once you install the script (which takes less than 2 mins), you can immediately start using the application by visiting the same URL. Now, it'll not redirect you to install.php.
PROBLEM: The script works perfectly for 1-2 days. The problem is after 2 days, the application breaks and it starts redirecting you to install.php page again. And, again you have to install it to make it work. This cycle keeps on repeating.
There is nothing wrong with the code and it is running perfectly in my localhost. The version of PHP in localhost is the same as that on my Hostinger server.
WHAT I HAVE TRIED: I tested the script in my localhost and it is running perfectly without breaking. Searching on the internet was not much helpful. However, I got the hint that the issue may be related to the MySQL database to upper/lower case characters.
Please, guide me on this.
Website file structure:
Without errors or other information do not think many will / can help you. I suggest checking your error / access logs first.
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 !
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.
I'm running Apache 2.046 with PHP 5.x and I am experiencing very odd behavior on a CodeIgniter app.
The frustrating thing is that it is not consistent.
Occasionally when I call up my app Apache returns nothing. I mean nada. But then I hit refresh and everything works as expected. Sometimes I have to hit "refreash" several times before the page will load. Other times it comes right up. When I started this post it was happening 80-90% of the time. Now I can't seem to make it happen. But it's been happening for several days so I have confidence in the next couple of page visits I will see it again.
This is on a development box that has very little traffic. When I do a PS I see several HTTP threads running - "top" reveals nothing un-expected (like a runaway process).
When I tail the apache access logs I don't even see a logged request when Apache returns blank. No Apache or PHP errors are being thrown.
I mention codeIgniter mostly because we're using the recommend .htaccess file with Mod Rewrite. So I wasn't sure if that was contributing to the issue. It also does not seem to be a problem with non-codeIgniter apps. That's hard to say with confidence since the issue is so inconsistent.
It does not seem to be client issue as we're seeing this happen from multiple client machines.
I can't tell if this is a server (hardware) issue, Apache issue or coding issue. Maybe it's a memory issue?
Any thoughts?
NEW INFORMATION:
IN the PHP log file I received this:
PHP Fatal error: fatal flex scanner internal error--end of buffer missed in /data/www/coreLib/codeIgniter/system/libraries/Hooks.php on line 226
Blank pages when using CI are usually caused by php errors with error messages suppressed.
Try re-enabling them and reloading.
error_reporting(E_ALL|E_WARNING)
If you suspect your Rewrite rules are the source of the problem, then crank mod_rewrite's logging level up and find out. Otherwise, the fact that everything works normally outside of your app makes this sound like it's a problem with your code or possibly the framework itself.