Apache error - PHP configured - resuming normal operations [MAC] - php

I've reinstalled apache and php using brew a few times and have gotten no where.
Currently my error log keeps showing:
[Sun Jan 10 22:40:01.548345 2016] [mpm_prefork:notice] [pid 35970] AH00173: SIGHUP received. Attempting to restart
[Sun Jan 10 22:40:01.578572 2016] [mpm_prefork:notice] [pid 35970] AH00163: Apache/2.4.16 (Unix) PHP/7.0.2 configured -- resuming normal operations
[Sun Jan 10 22:40:01.578609 2016] [core:notice] [pid 35970] AH00094: Command line: '/usr/local/Cellar/httpd24/2.4.16/bin/httpd'
My localhost server is working fine and displays the 'It Works!!!' page.
However, when I try to load a standard phpinfo page, it just displays the code. I'm guessing that's happening because of the errors above, so any suggestions to fix this ?

Related

php files aren't loaded, due to unknown apache errors

I am using apache to run php files in firefox dev edition but some of them won't work.
I guess its because of the following errors that are being shown in console for
apache2: [Mon Dec 18 08:57:59.610192 2017] [mpm_prefork:notice] [pid 121] AH00163: Apache/2.4.28 (Unix) PHP/7.1.7 configured --
resuming normal operations
[Mon Dec 18 08:57:59.610276 2017] [core:notice] [pid 121] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND' .
If I click "submit" in my self-made register form, it is supposed to open the next file, which fails:

httpd on AWS suddenly stopped working after I set an A record

So today, I was trying to do two things: get rid of extensions like .php in my domains, and use an A record to point a subdomain I have to the IP of the server on which the site I am developing is running on.
I did both at the same time, then restarted httpd, but when it came back up - I couldn't access the website at all. httpd claims it is running fine. I decided to remove the rewrite rules to see if I had somehow introduced a bug into httpd.conf, but after another restart, it still didn't serve webpages. I tried restarting the server instance - no luck again.
I hadn't changed anything else and the server was serving webpages fine before this. I am trying to access the page using just the IP address, so I don't think the A record could have made a difference either.
The output in httpd's error log is the following:
[Wed Aug 10 16:39:44.263098 2016] [suexec:notice] [pid 1843] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
[Wed Aug 10 16:39:44.308130 2016] [auth_digest:notice] [pid 1843] AH01757: generating secret for digest authentication ...
[Wed Aug 10 16:39:44.308701 2016] [lbmethod_heartbeat:notice] [pid 1843] AH02282: No slotmem from mod_heartmonitor
[Wed Aug 10 16:39:44.662464 2016] [mpm_prefork:notice] [pid 1843] AH00163: Apache/2.4.18 (Amazon) configured -- resuming normal operations
[Wed Aug 10 16:39:44.662486 2016] [core:notice] [pid 1843] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Wed Aug 10 16:40:02.960708 2016] [mpm_prefork:notice] [pid 1843] AH00171: Graceful restart requested, doing restart
[Wed Aug 10 16:40:03.042697 2016] [auth_digest:notice] [pid 1843] AH01757: generating secret for digest authentication ...
[Wed Aug 10 16:40:03.043290 2016] [lbmethod_heartbeat:notice] [pid 1843] AH02282: No slotmem from mod_heartmonitor
[Wed Aug 10 16:40:03.105719 2016] [mpm_prefork:notice] [pid 1843] AH00163: Apache/2.4.18 (Amazon) configured -- resuming normal operations
[Wed Aug 10 16:40:03.105729 2016] [core:notice] [pid 1843] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Wed Aug 10 16:40:03.105750 2016] [mpm_prefork:warn] [pid 1843] AH00167: long lost child came home! (pid 1968)
Any help?
Edit: I used dig on the domain that I pointed with the A-record, and it resolves to the IP (which currently times out but is otherwise the right IP). So it seemingly isn't an issue there, either. I can connect to the server with SSH fine.

caught SIGTERM error PHP FAST-CGI APACHE Ubuntu14.4

I installed PHP 5.2.17 as per the following tutorial
http://zgadzaj.com/how-to-install-php-53-and-52-together-on-ubuntu-1204
apt-get installed PHP5.5 and apache 2.4.7
PHPINFO reports that the php version of the set host is still 5.5.9
when I restart apache2 service, I get the following in error.log.
[Thu Mar 19 14:18:53.648697 2015] [mpm_prefork:notice] [pid 23518] AH00169: caught SIGTERM, shutting down
[Thu Mar 19 14:18:54.741836 2015] [:notice] [pid 5543] FastCGI: process manager initialized (pid 5543)
[Thu Mar 19 14:18:54.754243 2015] [mpm_prefork:notice] [pid 5541] AH00163: Apache/2.4.7 (Ubuntu) mod_fastcgi/mod_fastcgi-SNAP-0910052141 PHP/5.5.9-1ubuntu4.6 configured -- resuming normal operations
[Thu Mar 19 14:18:54.754317 2015] [core:notice] [pid 5541] AH00094: Command line: '/usr/sbin/apache2'
Removing php5.5 solved the problem.
The problem probably was a conflict between the two PHP versions, using same fastcgi implementation.

The requested URL /LearnPHP5/learnPHP.php was not found on this server

I just downloaded Eclipse for Linux. Started a PHP tutorial and immediately hit a roadblock. The code is small:
<?php
echo 'Hello PHP World!';
When I run it as web application, I get:
Not Found
The requested URL /LearnPHP5/learnPHP.php was not found on this server.
Apache/2.4.7 (Ubuntu) Server at localhost Port 80
I have the Web Developer Tools installed on Eclipse, PHP installed on my Linux. and Apache2 running. I have this same issue with NetBeans too. Does anyone know why I'm getting this error? I have tried everything seen on the SO posts regarding this, but nothing has remedied the situation. I've been trying to sort it out all day. Any help wld be greatly appreciated.
This is from my apache error log:
[Fri Dec 05 16:39:17.808812 2014] [mpm_event:notice] [pid 8660:tid 140438963517312] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Fri Dec 05 16:39:17.808955 2014] [core:notice] [pid 8660:tid 140438963517312] AH00094: Command line: '/usr/sbin/apache2'
[Fri Dec 05 16:39:31.664085 2014] [mpm_event:notice] [pid 8660:tid 140438963517312] AH00491: caught SIGTERM, shutting down
[Fri Dec 05 16:39:32.768582 2014] [mpm_prefork:notice] [pid 9978] AH00163: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Fri Dec 05 16:39:32.768695 2014] [core:notice] [pid 9978] AH00094: Command line: '/usr/sbin/apache2'
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
I'm open to all advice. Never seen such a dilemma over such a small amount of code.
Look at log file (usually /var/log/apache2/error.log), where apache try to find your file /LearnPHP5/learnPHP.php .
It's seems like some mistake in the path to www root directory.

Getting Blank screen and nothing in logs. Is this Php syntax and Apache issue?

I am getting the blank screen. No errors in the Apache logs, nothing.
I was thinking there may be a php syntax error and it quietly dies, but I have configured php.ini to display errors:
display_errors=On
html_errors=On
error_reporting=E_ALL | E_STRICT
display_startup_errors=On
here are relevant php configurations loaded:
display_errors On On
display_startup_errors On
enable_dl Off Off
enable_post_data_reading On On
error_append_string no value no value
error_log no value no value
error_prepend_string no value no value
error_reporting 22527
Why is there no Apache error logs? How to trace Apache execution? any help is much appreciated. Thank you
Update:
I was wrong, Apache writes log only once on restart at the time of restart at the location specified by ErrorLog in the Apache Configuration, but nothing is written afterwards even when I get the blank site. Here logs from ErrorLog:
[Tue Nov 18 17:08:20.372970 2014] [mpm_prefork:notice] [pid 1601] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.4 configured -- resuming normal operations
[Tue Nov 18 17:08:20.376988 2014] [mpm_prefork:info] [pid 1601] AH00164: Server built: Jul 22 2014 14:36:39
[Tue Nov 18 17:08:20.377699 2014] [core:notice] [pid 1601] AH00094: Command line: '/usr/sbin/apache2'
[Tue Nov 18 17:19:32.301203 2014] [mpm_prefork:notice] [pid 1643] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.4 configured -- resuming normal operations
[Tue Nov 18 17:19:32.313839 2014] [mpm_prefork:info] [pid 1643] AH00164: Server built: Jul 22 2014 14:36:39
[Tue Nov 18 17:19:32.314481 2014] [core:notice] [pid 1643] AH00094: Command line: '/usr/sbin/apache2'
[Tue Nov 18 17:50:22.848631 2014] [core:info] [pid 1643] AH00096: removed PID file /var/run/apache2/apache2.pid (pid=1643)
[Tue Nov 18 17:50:22.848631 2014] [mpm_prefork:notice] [pid 1643] AH00169: caught SIGTERM, shutting down
[Tue Nov 18 17:50:25.288368 2014] [mpm_prefork:notice] [pid 3313] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.4 configured -- resuming normal operations
[Tue Nov 18 17:50:25.290696 2014] [mpm_prefork:info] [pid 3313] AH00164: Server built: Jul 22 2014 14:36:39
[Tue Nov 18 17:50:25.291613 2014] [core:notice] [pid 3313] AH00094: Command line: '/usr/sbin/apache2'
How to make Apache log for PHP errors or anything for that matter to be able troubleshoot issues?
It turns out this was neither Apache nor PHP error, but an application level issue where there is ErrorHandler function declared that does hide all the php errors as described here:
PHP's white screen of death
I came to conclusion to the fact that it is neither Apache nor PHP configurations by changing ErrorLevel to trace8 in virtual host settings:
LogLevel trace8
ErrorLog ${APACHE_LOG_DIR}/dev-virtual/error.log
Afterwards, I tail the logs specified in ErrorLog from command line and make requests. The logs showed:
[Tue Nov 18 18:16:37.398720 2014] [http:trace3] [pid 4054] http_filters.c(977): [client 10.88.12.0:49378] Response sent with status 200, headers:
...
[Tue Nov 18 18:16:37.399243 2014] [http:trace4] [pid 4054] http_filters.c(806): [client 10.88.12.0:49378] Content-Length: 0
...
Here, the logs shows 200 response with Content-Length:0. The 200 is good response from Apache, so its not Apache error responsible for the blank page. Seeing the Content-Lenght set to 0, made me think there is something more than PHP setup/configuration issue. It was the ErrorHandler at the Application level.

Categories