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'
Related
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.
I am running XAMPP and have rebuilt my PHP server from the ground up, renamed the server from ServerV1 to ServerV2, and now attempting a basic POST request from Android volley, returns the error found within the Apache logs:
[Sat Dec 19 19:24:57.528601 2015] [core:notice] [pid 7956:tid 260] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Sat Dec 19 19:24:57.531601 2015] [mpm_winnt:notice] [pid 7956:tid 260] AH00418: Parent: Created child process 5784
[Sat Dec 19 19:24:58.047631 2015] [ssl:warn] [pid 5784:tid 272] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Dec 19 19:24:58.290645 2015] [ssl:warn] [pid 5784:tid 272] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Dec 19 19:24:58.325647 2015] [mpm_winnt:notice] [pid 5784:tid 272] AH00354: Child: Starting 150 worker threads.
I am not listening on any used ports:
I have research others simply running as an administrator in sources like: https://teamtreehouse.com/community/solved-xampp-apache-error and
XAMPP - Apache Error
Upon attempting that, it still does not work, where the only return from any POST is a 0.
NOTE: I have tested every action with google chromes POSTMAN and know my routes do work and return the proper JSON objects.
https://chrome.google.com/webstore/detail/postman-rest-client-short/mkhojklkhkdaghjjfdnphfphiaiohkef?hl=en
What steps can I take to alleviate this issue?
Try just by commenting Listen 443 (like #Listen 443)in httpd-ssl.conf file. it will Work 100%. Mine site it has work 100%.
Try this:
Open httpd-ssl.conf here:
C:\xampp\apache\conf\extra
Comment out the line and change it to localhost
#ServerName www.example.com:443
ServerName localhost
And of course restart your Apache
i know this is late but i've found the answer... Apparently you have to right click on the xampp-control.exe file and run it as administrator, and then probably it works perfectly now! that worked for me.
just shutdown that application which is using 443 port & retry. mine vmware workstation was using 443 port i just kill process tree of vmware & retried it works for me.
I faced this issue after copying my xampp folder from windows 7 to another installation of windows 10.
Have tried the solutions listed here, but none worked for me. I had no time to try other solutions so I just made a new installation from scratch
installing new xampp (7.3.16) works for me
This is possible due to DocumentRoot path have not set correctly.
I had the same issue, and I solved it. The reason for me was because port 8080 was in use. I found it by running "netstat -ab" in the command prompt in administrator mode. Then I changed the port (From both xampp config and httpd.conf) for something else and it worked.
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)
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).
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?