XAMPP causing 'The connection was reset' error in Firefox - php

I'm experiencing problems when running a specific PHP file; in the latest Firefox it keeps giving the error 'The connection was reset' (I've tried running the PHP file in a different browser - the latest Internet Explorer but get the same problem).
I've also tried completely uninstalling both XAMPP and Firefox (default browser) - then reinstalling them.
I have even tried clearing the cache in Firefox and also ran CCleaner.
I'm not sure what is causing this problem as when I run the exact PHP file on another machine (on Windows 7 - with XAMPP & latest Firefox) it works perfectly fine and it is not like the PHP file is fairly complex/resource intensive (it does not even call/use MySQL!)? :S
I have tried integrating some debug/error reporting code within the PHP file - but that does not produce/do anything, but I've noticed whenever the PHP file is ran; apache does create/update an 'error.log' file within the 'XAMPP/apache/logs' folder with the following errors:
[Tue May 28 07:31:18.158004 2013] [ssl:warn] [pid 2404:tid 328] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Tue May 28 07:31:18.283009 2013] [mpm_winnt:notice] [pid 2404:tid 328] AH00455: Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7 configured -- resuming normal operations
[Tue May 28 07:31:18.283009 2013] [mpm_winnt:notice] [pid 2404:tid 328] AH00456: Server built: Aug 18 2012 12:41:37
[Tue May 28 07:31:18.283009 2013] [core:notice] [pid 2404:tid 328] AH00094: Command line: 'c:\\users\\admin\\xampp\\apache\\bin\\httpd.exe -d C:/Users/Admin/XAMPP/apache'
[Tue May 28 07:31:18.283009 2013] [mpm_winnt:notice] [pid 2404:tid 328] AH00418: Parent: Created child process 4112
PS-1: I noticed it is referring to SSL within the above log - I'm not using SSL?.
PS-2: The XAMPP settings are exactly the same since the install (like I have not modified/updated php.ini or have added anything that does within the .htaccess file).
OS: Windows 8 (64 bit)
XAMPP: 1.8.1 (installed relatively to user 'Admin' => 'C:/Users/Admin/XAMPP')
Browsers: Latest - Firefox (default) and Internet Explorer, both have NO third-party extensions/add-ons installed/enabled
Security programs: Avira Free Antivirus, Malwarebytes Anti-Malware (PRO) and KeyScrambler (Personal)

I had what might be a similar problem a few years back, and, if I recall correctly, it was caused by using Notepad to write the script. Upon switching to another text editor the problem was fixed. As I recall, there were hidden characters inserted by Notepad (or whatever it was that I had used).

Related

Cannot get SilverStripe site working on Amazon Linux 2 Server?

I am trying to get this website online, mainly for my own intellectual curiosity (CS student) but also for functional use. The site is built on SilverStripe 4 and developed on a LAMP stack environment.
I have the final SilverStripe site working on my local machine (docker environment using the brettt89/silverstripe-web:7.4-apache image), with another container running MySQL for the database.
I'm using AWS EC2 and followed the tutorial on setting up a LAMP stack which included selecting the Amazon Linux 2 Image. I have a single EC2 and RDS running within a VPC that is configured correctly (a test PHP script was able to connect to the db server, query and insert data). In the spirit of incrementally getting things to work, I installed Composer on the EC2 and the PHP extensions listed on SilverStripe's documentation as required. I then ran a composer create-project silverstripe/installer my-project and created an ENV file that is the same as my docker environment (still in dev mode) but with the specified endpoint for the db given by the RDS management console.
I also changed the web root of the Apache server to the public subfolder of my site which is: /var/www/html/my-project/public
Note: I also ran the website before changing the webroot and the result was the same.
The site unfortunately returns a server error (HTTP error 500) and the error logs give me some cryptic looking messages that I have been unable to fix. My own suspicion is that there are some file or directory permissions that have been set wrong, so I will share a screenshot.
File permissions of web directory
Not sure if this helps, but from /etc/httpd/logs/error_log:
[Sun Sep 18 03:10:01.441647 2022] [ssl:warn] [pid 13852:tid 139677397750336] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Sun Sep 18 03:10:01.441731 2022] [lbmethod_heartbeat:notice] [pid 13852:tid 139677397750336] AH02282: No slotmem from mod_heartmonitor
[Sun Sep 18 03:10:01.443062 2022] [mpm_event:notice] [pid 13852:tid 139677397750336] AH00489: Apache/2.4.54 () OpenSSL/1.0.2k-fips configured -- resuming normal operations
[Sun Sep 18 03:10:01.443080 2022] [core:notice] [pid 13852:tid 139677397750336] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

Running Laravel on local machine

I am trying to run a laravel project in my local machine. It starts normally on http://127.0.0.1:8000 but when I try to open the url in the browser the port changes to 8001 and the new url is http://127.0.0.1:8001. When I try to open this in the browser, again the port changes to 8002.
Image showing the issue
composer.json
My PHP version is 7.4.1. If anyone else faced this issue earlier or knows how to fix this issue, please help in fixing this issue.
Thank you.
Update 1:
Noticed something. Whenever database related code is executed, this issue is popping up. For example, when I try to execute the following code shown in the image, it runs smoothly and I can see the output in the browser. Case when the code runs smoothly
But when I change the code to the following, the issue shows up.
Case when the issue shows up. This is not any database heavy query but why this issue? Any leads would be very helpful.
Update 2:
Found nothing in laravel logs but found the following in the apache error log which is given below:
[Thu Jun 09 21:37:24.988703 2022] [mpm_winnt:crit] [pid 2660:tid 704] AH02538: Child: Parent process exited abruptly. Child process is ending
[Thu Jun 09 21:37:27.399609 2022] [core:warn] [pid 8084:tid 576] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Thu Jun 09 21:37:27.446479 2022] [mpm_winnt:notice] [pid 8084:tid 576] AH00455: Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.4.1 configured -- resuming normal operations
[Thu Jun 09 21:37:27.446479 2022] [mpm_winnt:notice] [pid 8084:tid 576] AH00456: Apache Lounge VC15 Server built: Aug 11 2019 12:20:04
[Thu Jun 09 21:37:27.446479 2022] [core:notice] [pid 8084:tid 576] AH00094: Command line: 'c:\xampp\apache\bin\httpd.exe -d C:/xampp/apache'
[Thu Jun 09 21:37:27.446479 2022] [mpm_winnt:notice] [pid 8084:tid 576] AH00418: Parent: Created child process 10064
[Thu Jun 09 21:37:28.196453 2022] [mpm_winnt:notice] [pid 10064:tid 664] AH00354: Child: Starting 150 worker threads.
Try this parameter I think help you
php artisan serve --port=8080
This highly, might be a problem to the code, you've write-ed, not a Laravel problem. I've faced issues like this before for a long time ago, so you might check :
The code is processing in blade or controller.
Or it might be a memory issues related to PC (might not be, related to this issue, but i had a lots of memory issues back then when i had low-end PC and all these issues was happening.)
As I said, my first guess is the code, so you might need to share the code find out, what is happening.
Also conflicts in reserved ports will be avoided anyway, for example if you set your local environment server to something else(8080), same issue will happen again.
And sometime if you close your terminal without closing local environment, new php artisan serve will run the local environment anyway, for example, my terminal/IDE was closed but application was serving, and doing php artisan serve not forced me to close and run a new local environment like yours, it was trying to serve again, but old one was doing conflicts.
So as I said again, it might be a code issue.
Double check your code or share it to find the issue.

Softaculous Ampps 3.8 Apache not starting if i change PHP version to 7.1

I have a recent problem in Ampps Software on Windows 10, Apache stopping automatically if PHP version is 7.1 but if I change back PHP Version to 5.6 it's working fine
and here's the error log for Apache
<pre>
[Mon Oct 22 10:28:12.413768 2018] [mpm_winnt:notice] [pid 12484:tid 684] AH00455: Apache/2.4.27 (Win32) OpenSSL/1.1.0f PHP/5.6.31 configured -- resuming normal operations
[Mon Oct 22 10:28:12.413768 2018] [mpm_winnt:notice] [pid 12484:tid 684] AH00456: Apache Lounge VC15 Server built: Jul 7 2017 11:43:51
[Mon Oct 22 10:28:12.413768 2018] [core:notice] [pid 12484:tid 684] AH00094: Command line: 'apache\\bin\\httpd.exe -d D:/Ampps/apache'
[Mon Oct 22 10:28:12.417758 2018] [mpm_winnt:notice] [pid 12484:tid 684] AH00418: Parent: Created child process 5924
[Mon Oct 22 10:28:13.307885 2018] [mpm_winnt:notice] [pid 5924:tid 740] AH00354: Child: Starting 64 worker threads.
[Mon Oct 22 10:28:45.068164 2018] [mpm_winnt:notice] [pid 9816:tid 700] AH00455: Apache/2.4.27 (Win32) OpenSSL/1.1.0f PHP/7.1.8 configured -- resuming normal operations
[Mon Oct 22 10:28:45.068164 2018] [mpm_winnt:notice] [pid 9816:tid 700] AH00456: Apache Lounge VC15 Server built: Jul 7 2017 11:43:51
[Mon Oct 22 10:28:45.068164 2018] [core:notice] [pid 9816:tid 700] AH00094: Command line: 'apache\\bin\\httpd.exe -d D:/Ampps/apache'
[Mon Oct 22 10:28:45.070158 2018] [mpm_winnt:notice] [pid 9816:tid 700] AH00418: Parent: Created child process 15180
[Mon Oct 22 10:28:47.563384 2018] [mpm_winnt:crit] [pid 9816:tid 700] AH00419: master_main: create child process failed. Exiting.
</pre>
I didn't change anything or install anything new, and I reinstalled it many times and tried XAMPP it's working fine
Thank you.
Its solved by disabling Ioncube loader extension for me, Thanks for all replies
Try changing the php version used by AMPPS by following their guide here ->
http://www.ampps.com/wiki/How_to_change_php_version
In the AMPPS control panel, select options and then select change php version. The changed version should now be displayed in the control panel.
Try run httpd.exe with as administrator and it worked.
C:\Program Files (x86)\Ampps\apache\bin
I know this is 4 months old, but I have had significant problems with PHP on windows and today I got this problem fixed.
AMPPS - It won’t run PHP 7.1 with out changing the executables to run as administrator mode. Apache will terminate without an error. I believe this is because even if AMPPS is running in admin priviledges these are not granted to the php.exe when it is run. Go to the file location of php.exe, right click and click on properties, click the compatibility tab and select the check box for ‘run as administrator’. Do the same for the httpd.exe under apache->bin->httpd.exe. (Not sure if the httpd priviledge change matters but I did it and it worked.)
Run AMPPS and hopefully like me, your php/apache problems are gone.
i solved mine following steps below:
i switched PHP version to 5.6 which everything works normally,
then went to this URL:
http://localhost/ampps/index.php?
there i found some updates available
notification on top of the page below url bar on the page
if you see updates available for your php 7.0 7.1 ...
90% you will resolve this issue like mine
i tried update all available updates
then restart the ampps app
now working with PHP 7.1 great.
i hope it works for you as well.
A bit late but since i've been using Ampps for 5 years , i provide similar solutions for my common errors maybe someone find it useful .
If you changed Document Root path in "httpd.conf" , make sure that folder still exists.
If you see the logs about InnoDB files, follow the path and delete that dump files and logs.
If you got this error "master_main: create child process failed" in log files :
Change PHP version to 7.1 and Try this:
Open AMPPS panel --> PHP --> Configuration.
Search for the following line and comment it by adding ';' at the beginning of the line: zend_extension="{$path}\php-7.1\ioncube_loader_win_7.1.dll"

Server truncates/interrupts output when request comes from external computer, but not from 127.0.0.1

Setup:
EasyPHP Dev server 13.1VC11 (Apache 2.2.4, MySQL 5.6.12, PHP 5.5.0)
Windows 7.
Apache is set up with multiple virtual hosts each pointing to a separate folder under ...data\localweb\.
Server also acts as a gateway between internet and local network.
My wife has made a webpage which includes JavaScript and jQuery and PHP.
When I open a browser on my server computer and access the pages, everything works as they should. Via both these addresses:
http://127.0.0.1/liselotte/projekt5/2vs.php
http://liselotte.mine.nu/projekt5/2vs.php
However, when I try to access the page from another computer on my local network, the two longer pages in my wife's project gets truncated. (file 2vs.php, also accessible on the page's main menu as "V/S") It always gets truncated at the same place, in the middle of a 8-letter word, in a piece of HTML formatted text.
I use Firefox and can see when the code cuts off before the browser displays an error message that "transfer was aborted". (It's in Swedish, so I'm a bit uncertain about the exact wording of the message) "The connection to the server was severed during retrieval of the page". (no HTTP-error number)
I have also tried Internet Explorer and Chrome, transfer is cut off at the exact same place every time.
Weirdly enough, the page seems to work when accessed from internet.
The Apache config file contains
Listen 127.0.0.1:80
Listen trilliadin.mine.nu:80 #which is one of the virtual hosts
Listen 192.168.137.1:80 #which is Windows local address assigned to my LAN
I've tested disabling all firewalls, but no difference.
I dumped about 4MB text into a file.html to see if this also gets truncated but the whole text-file gets transferred.
Does anyone recognize these symptoms?
EDIT:
Regarding error-reporting... I do get some weird apache-errors when I start the server.
[Wed Jan 15 21:13:37.989659 2014] [mpm_winnt:notice] [pid 968:tid 424] AH00424: Parent: Received restart signal -- Restarting the server.
Failed loading D:\EasyPHP\binaries\php\php_runningversion\php_xdebug-2.2.2-5.4-vc9.dll
PHP Warning: PHP Startup: in Unknown on line 0
[Wed Jan 15 21:13:39.861663 2014] [mpm_winnt:notice] [pid 968:tid 424] AH00455: Apache/2.4.4 (Win32) PHP/5.5.0 configured -- resuming normal operations
[Wed Jan 15 21:13:39.861663 2014] [mpm_winnt:notice] [pid 968:tid 424] AH00456: Server built: Apr 8 2013 13:46:39
[Wed Jan 15 21:13:39.861663 2014] [core:notice] [pid 968:tid 424] AH00094: Command line: 'D:\\EasyPHP\\binaries\\apache\\bin\\apache.exe -d D:/EasyPHP/binaries/apache'
[Wed Jan 15 21:13:39.861663 2014] [mpm_winnt:notice] [pid 968:tid 424] AH00418: Parent: Created child process 5240
[Wed Jan 15 21:13:40.017663 2014] [mpm_winnt:notice] [pid 5328:tid 436] AH00364: Child: All worker threads have exited.
Failed loading D:\EasyPHP\binaries\php\php_runningversion\php_xdebug-2.2.2-5.4-vc9.dll
PHP Warning: PHP Startup: in Unknown on line 0
[Wed Jan 15 21:13:41.655666 2014] [mpm_winnt:notice] [pid 5240:tid 432] AH00354: Child: Starting 64 worker threads.
But I don't understand what it means. Tonight, the Virtual Host liselotte.mine.nu became unresponsive, while virtual host trilliadin.mine.nu continued working. The problem resolved when I restarted the apache server. (see error log above)

PHP OpenSSL - openssl_private_encrypt crashes webpage

This has been reported at bugs.php.net. If I replace libeay32.dll and ssleay32.dll in xampp/apache/bin with the same files in xampp/php/ then it works but I CANNOT use SSL
I need to use SSL, has anyone been able to resolve this?
I am using OpenSSL library in PHP(5.4.7) on XAMPP(1.8.1) for encryption, decryption, etc. I am also using SSL on localhost.
I am able to create the private-public key pair using openssl_pkey_new() method and generate the certificate as well.
But when I try to access my root certificate (create using the above function) the webpage crashes:
$root_private_key = openssl_get_privatekey(file_get_contents($path), $pass);
echo "KEY: " . $root_private_key; // KEY: Resource id #11
openssl_private_encrypt($plaintext, $encrypted_data, $root_private_key);
I even tried using phpseclib library but that also does the same thing.
I have also tried to set ini_set('max_execution_time', 0);
I checked PHP log and it is empty and found the following in Apache logs:
[mpm_winnt:notice] [pid 3312:tid 484] AH00428: Parent: child process exited with status 3221225477 -- Restarting.
[ssl:warn] [pid 3312:tid 484] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[mpm_winnt:notice] [pid 3312:tid 484] AH00455: Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7 configured -- resuming normal operations
[mpm_winnt:notice] [pid 3312:tid 484] AH00456: Server built: Aug 18 2012 12:41:37
[core:notice] [pid 3312:tid 484] AH00094: Command line: 'apache\\bin\\httpd.exe -d C:/xampp/apache'
[mpm_winnt:notice] [pid 3312:tid 484] AH00418: Parent: Created child process 1520
AH00548: NameVirtualHost has no effect and will be removed in the next release C:/xampp/apache/conf/extra/httpd-vhosts.conf:19
[ssl:warn] [pid 1520:tid 496] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[mpm_winnt:notice] [pid 1520:tid 496] AH00354: Child: Starting 150 worker threads.
I have tried following but none of that helps:
PHP openssl_public_encrypt causing Page Timeout/Connection Reset?
php/timeout/connection to server reset?
Apache server (xampp) crashes when using openssl function
PHP dies unexpectedly without error
I would appreciate any help/suggestion.
For those of you still having trouble:
Until a fully packaged official build of xampp is released with the next version of apache which should fix this bug, I have successfully fixed this issue by changing my version of Apache to one found here: http://www.apachelounge.com/download/ This fixes the bug but still allows me to use OpenSSL
The second Apache 2.2.4 download on this page was built specifically to fix this bug. For me it was easy as:
Stopping Apache
Renaming xampp\apache to xampp\apacheold just in case it broke.
Copied in the Apache24 to xampp\Apache24 from the downloaded zip
Renamed it to apache
Copied the .bat files from the xampp\apacheold folder into the new xampp\apache folder.
Replaced the xampp\apache\conf folder with the one from xampp\apacheold
Start Apache again
I Hope this helps somebody.
This has been reported at bugs.php.net. If I replace the following files in xampp/apache/bin with the same files in xampp/php/ then it works:
libeay32.dll
ssleay32.dll
BUT, SSL cannot be used otherwise Apache gives error when starting up.
phpseclib uses OpenSSL, if available, for RSA private key generation. To disable this behavior do this after Crypt/RSA.php has been included:
define('CRYPT_RSA_MODE', CRYPT_RSA_MODE_INTERNAL);
How big, btw, is the key you're trying to generate?

Categories