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.
Related
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.
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 ?
Problem: Apache keeps crashing if I try to update the global $_SESSION variable in PHP. These are the entries added to error.log in case of a crash.
From apache\logs\error.log:
[Mon Jun 29 14:10:34.142373 2015] [mpm_winnt:notice] [pid 6644:tid 316] AH00428: Parent: child process 1440 exited with status 3221225477 -- Restarting.
[Mon Jun 29 14:10:34.262613 2015] [mpm_winnt:notice] [pid 6644:tid 316] AH00455: Apache/2.4.12 (Win32) PHP/5.6.8 configured -- resuming normal operations
[Mon Jun 29 14:10:34.262613 2015] [mpm_winnt:notice] [pid 6644:tid 316] AH00456: Apache Lounge VC11 Server built: Jan 28 2015 16:48:40
[Mon Jun 29 14:10:34.262613 2015] [core:notice] [pid 6644:tid 316] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Mon Jun 29 14:10:34.266524 2015] [mpm_winnt:notice] [pid 6644:tid 316] AH00418: Parent: Created child process 6376
[Mon Jun 29 14:10:35.026097 2015] [mpm_winnt:notice] [pid 6376:tid 428] AH00354: Child: Starting 150 worker threads.
Windows Event viewer
About my source code: I have a php script and intend to add variables to an existing session. For that matter, I use $_SESSION and set some keys to arrays, i.e. $_SESSION['foo'] = bar, where bar is an array containing objects of a very simple class having only some string attributes.
If I do that the first time, I'm fine. If I re-assign a value to $_SESSION['foo'] after reloading the page, Apache crashes and immediately restarts. I was able to isolate the crash to this very line, as commenting it out turned out to prevent the crash. First, I assumed my session is somehow corrupted or I use it incorrectly. But if I manually set $_SESSION['foo'] = "", instead of assigning an array, no crash occurs.
Similar reports I found in the web had different error sources, so I tried a few things, e.g.:
Run XAMPP as administrator
Increase the thread stack size in httpd.conf
Deactivate unused php-extensions
Switched to different ports, etc.
Turned off SSL
Unfortunately, nothing helped in my case.
PS: I use XAMPP v.3.2.1 with PHP 5.6.8 on Windows 8.1 (64bit).
EDIT: As suggested by donald123, I turned off SSL. The error persists, but I posted a cleaner log snippet.
I've installed WampServer so many times, and everytime i face this problem.
The wamp tray icon is orange :
and i get this errors in the Apache Error Log :
[Sun May 31 07:29:32.246382 2015] [mpm_winnt:notice] [pid 2972:tid 376] AH00455: Apache/2.4.9 (Win32) PHP/5.5.12 configured -- resuming normal operations
[Sun May 31 07:29:32.246382 2015] [mpm_winnt:notice] [pid 2972:tid 376] AH00456: Apache Lounge VC11 Server built: Mar 16 2014 12:13:13
[Sun May 31 07:29:32.246382 2015] [core:notice] [pid 2972:tid 376] AH00094: Command line: 'f:\wamp\bin\apache\apache2.4.9\bin\httpd.exe -d F:/wamp/bin/apache/apache2.4.9'
[Sun May 31 07:29:32.527182 2015] [mpm_winnt:notice] [pid 2972:tid 376] AH00418: Parent: Created child process 2700
[Sun May 31 07:29:59.421630 2015] [mpm_winnt:crit] [pid 2972:tid 376] AH00419: master_main: create child process failed. Exiting.
When i test the port 80 it says :
Checked the System Environment Variables for errors and understood nothing there :
What Causes this problem?
Please check that you have the Visual C++ Redistributable for Visual Studio 2012 Update 4 installed on this computer.
Apache 2.4.9 requires this library to be installed.
Click the download button and then select either the X86(32bit) or X64(64bit) link to match the version of WAMPServer(32 or 64) that you installed.
If you are running on a 64bit Windows, its a good idea to download and install both the 64 and 32 bit libraries, as something somewhere you use in the future will also require the library.
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.