I was following a tutorial to install APC on my centos vps, and then I ran into a trouble, so found some help here, now my PHP isn't working on apache.
Only the very root index.php works, no other root pages, none in sub directories. If I access the php directly, it forces a download of the file.
This is odd because php has always worked on the server for over a year. When I check error_log, I see this.
[Thu Feb 27 05:56:35 2014] [notice] caught SIGTERM, shutting down
[Thu Feb 27 05:56:35 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Feb 27 05:56:35 2014] [notice] Digest: generating secret for digest authentication ...
[Thu Feb 27 05:56:35 2014] [notice] Digest: done
[Thu Feb 27 05:56:35 2014] [notice] Apache/2.2.15 (Unix) DAV/2 configured -- resuming normal operations
Anyone have any ideas as to why this is happening?
That's actually a completely normal log
[Thu Feb 27 05:56:35 2014] [notice] caught SIGTERM, shutting down
SIGTERM is sent to daemons being shutdown/restarted
[Thu Feb 27 05:56:35 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
The server is starting, suExec is enabled
[Thu Feb 27 05:56:35 2014] [notice] Digest: generating secret for digest authentication ...
[Thu Feb 27 05:56:35 2014] [notice] Digest: done
Digest authentication is initialized
[Thu Feb 27 05:56:35 2014] [notice] Apache/2.2.15 (Unix) DAV/2 configured -- resuming normal operations
Apache is ready.
You should use the most paranoid logging settings you can for PHP, it hasn't yet told you what is wrong ;)
Related
i have an angular application with Yii2 restful , when i load application there are a lot of resources with multiple rest api requests at the first.
sometimes a rest api failed with (failed) status and net::ERR_CONNECTION_RESET in chrome browser. when an api request failed all other api requests also failed.
i'm using windows , apache , php 7.1 (xampp)
also i have same problem with linux and nginx
my apache error log :
[Tue Oct 09 11:16:12.832792 2018] [mpm_winnt:notice] [pid 3392:tid 508] AH00428: Parent: child process 11936 exited with status 3221226356 -- Restarting.
[Tue Oct 09 11:16:13.038794 2018] [ssl:warn] [pid 3392:tid 508] AH01909: www.example.com:4433:0 server certificate does NOT include an ID which matches the server name
[Tue Oct 09 11:16:13.061795 2018] [mpm_winnt:notice] [pid 3392:tid 508] AH00455: Apache/2.4.33 (Win32) OpenSSL/1.0.2n PHP/7.1.16 configured -- resuming normal operations
[Tue Oct 09 11:16:13.061795 2018] [mpm_winnt:notice] [pid 3392:tid 508] AH00456: Apache Lounge VC14 Server built: Mar 22 2018 10:55:30
[Tue Oct 09 11:16:13.061795 2018] [core:notice] [pid 3392:tid 508] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Tue Oct 09 11:16:13.064796 2018] [mpm_winnt:notice] [pid 3392:tid 508] AH00418: Parent: Created child process 3312
[Tue Oct 09 11:16:13.595807 2018] [ssl:warn] [pid 3312:tid 440] AH01909: www.example.com:4433:0 server certificate does NOT include an ID which matches the server name
[Tue Oct 09 11:16:13.708809 2018] [ssl:warn] [pid 3312:tid 440] AH01909: www.example.com:4433:0 server certificate does NOT include an ID which matches the server name
[Tue Oct 09 11:16:13.731810 2018] [mpm_winnt:notice] [pid 3312:tid 440] AH00354: Child: Starting 150 worker threads.
error image in chrome
I think it is about ThreadStackSize of apache but i can't increase it.
Is there anyone can help me please ?
Finally i found answer , it was about yii2 logging stack, when multiple requests sent to server concurrently, there were a lot of log stack that kept until the request ended then yii2 saved logs to database .
Also debugger module keeps logs until end of request.
When i decreased stack size of logs, requests executed correctly.
another way to solving this problem is changing db session to file session but i think its not good idea because we lose the speed and performance to executing requests.
Why Apache stop working after installing PHP MongoDB driver in PHP7.0.22 on Mac sierra on MAMP 4.2.1? I followed below step brew tap homebrew/PHP brew install php70-MongoDB extension="/usr/local/opt/php70-MongoDB/MongoDB.so"
Apache logs
[Mon Jan 08 19:32:00 2018] [notice] caught SIGTERM, shutting down
[Mon Jan 08 19:32:52 2018] [notice] Digest: generating secret for digest authentication ...
[Mon Jan 08 19:32:52 2018] [notice] Digest: done
[Mon Jan 08 19:32:52 2018] [notice] FastCGI: process manager initialized (pid 9604)
[Mon Jan 08 19:32:52 2018] [notice] Apache/2.2.32 (Unix) mod_wsgi/3.5 Python/2.7.13 PHP/7.0.22 mod_ssl/2.2.32 OpenSSL/1.0.2j DAV/2 mod_fastcgi/2.4.6 mod_perl/2.0.9 Perl/v5.24.0 configured -- resuming normal operations
[Mon Jan 08 19:34:38 2018] [notice] caught SIGTERM, shutting down
Okay, first of all I understand and ... permit ... you all to laugh: I have a local server running php 4,4 / apache / mysql - installed with xampp distribution. Just simply haven't got the time to upgrade all the code that has been serving me for years and is still serving me well :-)
To the issue - I can't make a try/catch ... beeeecause of the old php version. I have a script that parses a dir and to a lot of things to all the files ... and after several 100 thousand files over the years without problems ... I now find that the server shuts down / browser looses connection probably because of a single file ... but for my life I can't figure out which. So thought maybe I could figure it out through the error log. But ... I didn't learn much - and thought I might ask some wise guys here if there is anything I can learn from the following from my error log - regarding maybe what function/file or whatever it is that causes the breaking...:
[Tue Feb 14 20:47:26 2017] [crit] (22)Invalid argument: unable to replace stderr with error_log
[Tue Feb 14 20:47:26 2017] [crit] (2)No such file or directory: unable to replace stderr with /dev/null
[Tue Feb 14 20:47:26 2017] [notice] Apache/2.0.54 (Win32) mod_ssl/2.0.54 OpenSSL/0.9.8 PHP/4.4.0 mod_autoindex_color configured -- resuming normal operations
[Tue Feb 14 20:47:26 2017] [notice] Server built: Jul 28 2005 18:10:37
[Tue Feb 14 20:47:26 2017] [notice] Parent: Created child process 5384
[Tue Feb 14 20:47:27 2017] [notice] Child 5384: Child process is running
[Tue Feb 14 20:47:27 2017] [notice] Child 5384: Acquired the start mutex.
[Tue Feb 14 20:47:27 2017] [notice] Child 5384: Starting 250 worker threads.
[Tue Feb 14 20:47:36 2017] [notice] Parent: child process exited with status 3221225725 -- Restarting.
[Tue Feb 14 20:47:36 2017] [crit] (22)Invalid argument: unable to replace stderr with error_log
[Tue Feb 14 20:47:36 2017] [crit] (2)No such file or directory: unable to replace stderr with /dev/null
[Tue Feb 14 20:47:36 2017] [notice] Apache/2.0.54 (Win32) mod_ssl/2.0.54 OpenSSL/0.9.8 PHP/4.4.0 mod_autoindex_color configured -- resuming normal operations
[Tue Feb 14 20:47:36 2017] [notice] Server built: Jul 28 2005 18:10:37
[Tue Feb 14 20:47:36 2017] [notice] Parent: Created child process 3136
[Tue Feb 14 20:47:36 2017] [notice] Child 3136: Child process is running
[Tue Feb 14 20:47:36 2017] [notice] Child 3136: Acquired the start mutex.
[Tue Feb 14 20:47:36 2017] [notice] Child 3136: Starting 250 worker threads.
Got it ... filesize() was failing (silent aparently) for some file(s). Ran it w/o this function and it worked. Case closed...
Edit: strange though ... filesize() suddenly fails on all files. And they are local. Subdir to the htdocs folder ... and the top level folder to this structure is set to all my users to have full control of this folder and all subfolders... weird...
I'm here to ask about a strange behaviour of Apache with accents:
this rule works just fine
RewriteRule ^([èéìòùa-zA-Z0-9_\-\s]*)$ index.php?route=$1 [L]
but if i dare to add an 'à'
RewriteRule ^([àèéìòùa-zA-Z0-9_\-\s]*)$ index.php?route=$1 [L]
Apache loses his mind (Yes, I can hear you reading this with the Joker voice)
Can anyone explain this to me?
UPDATE: Error log
[Wed Nov 12 12:49:43 2014] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Wed Nov 12 12:49:43 2014] [notice] Apache/2.2.21 (Win64) mod_ssl/2.2.21 OpenSSL/1.0.0g PHP/5.3.10 configured -- resuming normal operations
[Wed Nov 12 12:49:43 2014] [notice] Server built: Sep 24 2011 19:57:51
[Wed Nov 12 12:49:43 2014] [notice] Parent: Created child process 3304
[Wed Nov 12 12:49:43 2014] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Wed Nov 12 12:49:44 2014] [notice] Child 3304: Child process is running
[Wed Nov 12 12:49:44 2014] [notice] Child 3304: Acquired the start mutex.
[Wed Nov 12 12:49:44 2014] [notice] Child 3304: Starting 64 worker threads.
[Wed Nov 12 12:49:44 2014] [notice] Child 3304: Starting thread to listen on port 80.
[Wed Nov 12 12:49:44 2014] [notice] Child 3304: Starting thread to listen on port 80.
I am trying to track down the cause of my Apache PHP crashes. I am hoping there is some kind of setting, tool or something to help track down what code, configuration or what the issue is that is causing these php crashes.
In my Windows event log I have (shows apache crashing, but caused by php):
Faulting application httpd.exe, version 2.2.21.0, time stamp 0x4e6b3136, faulting module php5ts.dll, version 5.3.8.0, time stamp 0x4e537a04, exception code 0xc0000005, fault offset 0x0000c7d7, process id 0xbf4, application start time 0x01cd45afc42f0b7d.
The application utilizes Apache, PHP and MySQL on a Windows Server 2008 machine (xampp).
This is the crash in my Apache log:
[Fri Jun 08 15:56:34 2012] [notice] Parent: child process exited with status 3221225477 -- Restarting.
[Fri Jun 08 15:56:35 2012] [notice] Digest: generating secret for digest authentication ...
[Fri Jun 08 15:56:35 2012] [notice] Digest: done
[Fri Jun 08 15:56:35 2012] [notice] Apache/2.2.21 (Win32) PHP/5.3.8 configured -- resuming normal operations
[Fri Jun 08 15:56:35 2012] [notice] Server built: Sep 10 2011 11:34:11
[Fri Jun 08 15:56:35 2012] [notice] Parent: Created child process 1220
[Fri Jun 08 15:56:35 2012] [notice] Digest: generating secret for digest authentication ...
[Fri Jun 08 15:56:35 2012] [notice] Digest: done
[Fri Jun 08 15:56:35 2012] [notice] Child 1220: Child process is running
[Fri Jun 08 15:56:35 2012] [notice] Child 1220: Acquired the start mutex.
[Fri Jun 08 15:56:35 2012] [notice] Child 1220: Starting 150 worker threads.
[Fri Jun 08 15:56:35 2012] [notice] Child 1220: Starting thread to listen on port 80.
[Fri Jun 08 15:56:35 2012] [notice] Child 1220: Starting thread to listen on port 80.
[Fri Jun 08 15:57:37 2012] [notice] Parent: child process exited with status 3221225477 -- Restarting.
[Fri Jun 08 15:57:37 2012] [notice] Digest: generating secret for digest authentication ...
[Fri Jun 08 15:57:37 2012] [notice] Digest: done
[Fri Jun 08 15:57:37 2012] [notice] Apache/2.2.21 (Win32) PHP/5.3.8 configured -- resuming normal operations
[Fri Jun 08 15:57:37 2012] [notice] Server built: Sep 10 2011 11:34:11
[Fri Jun 08 15:57:37 2012] [notice] Parent: Created child process 3932
[Fri Jun 08 15:57:38 2012] [notice] Digest: generating secret for digest authentication ...
[Fri Jun 08 15:57:38 2012] [notice] Digest: done
[Fri Jun 08 15:57:38 2012] [notice] Child 3932: Child process is running
[Fri Jun 08 15:57:38 2012] [notice] Child 3932: Acquired the start mutex.
[Fri Jun 08 15:57:38 2012] [notice] Child 3932: Starting 150 worker threads.
[Fri Jun 08 15:57:38 2012] [notice] Child 3932: Starting thread to listen on port 80.
[Fri Jun 08 15:57:38 2012] [notice] Child 3932: Starting thread to listen on port 80.
Any thoughts on what I should try, or tools/techniques to trace back to what code, etc. might be causing this?
Since XAMPP's Apache (for Windows) is built with winn_nt MPM (multi-thread) + Thread-Safe PHP, it may be that you are hitting a problem inherent to the supposedly Thread-Safe versions of PHP (see this very good post for more information). This could explain why you never encounter the error when running in a single-user mode.
Please let us know if Uku Loskit's suggestion did any good. If not, I would recommend switching to a Prefork + Non-Thread-Safe PHP setup in such a multi-user environment.
Because MPM must be chosen at compile-time, you would need to either:
compile Apache yourself (technically feasible, but quite a pain in the neck on Windows, as far as I remember)
find a distribution other than XAMPP, which is built with prefork (I do not know any)
Perhaps you'd better try to run PHP with FastCGI (this extra layer basically isolates server threads by starting a separate PHP process for each thread, and much more). This should allow you to verify easily enough my initial assumption.
Just a side note: I do not see the point in installing Apache on a Windows Server. You may want to consider either using IIS, optionally with FastGCI (see instructions here), or (better) switch to a Linux-based stack.