php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #31391 phpinfo -> Apache up-time
Submitted: 2005-01-03 18:26 UTC Modified: 2005-01-11 14:02 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: ceo at l-i-e dot com Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: Irrelevant OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ceo at l-i-e dot com
New email:
PHP Version: OS:

 

 [2005-01-03 18:26 UTC] ceo at l-i-e dot com
Description:
------------
It would be Really Nifty (tm) if phpinfo would output how long Apache has been running.

So when you think you re-started Apache, but it silently failed because of a dumb /etc script, you know why that change to httpd.conf or php.ini didn't work.

Or if you're a newbie and you are staring at that phpinfo() output, you'll realize more quickly that the world is not what you think it is, because Apache was supposed to have been re-started.

Or...

I just think it would help reduce the number of confused users, particularly the less experienced ones.

Hey, server up-time would also be Good Thing (tm), while you're at it.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-05 06:35 UTC] jed@php.net
I do not see any harm in this, save that it would be limiting a feature to a specific server by design. Perhaps if it was implemented on *all* SAPIs that it is in context on, not just Apache?

The bigger question, I suppose, is "is this the place of phpinfo()"?

As I understand it, phpinfo() is used to check configuration, but the manual states:

"Outputs a large amount of information about the current state of PHP."

Perhaps server uptime *is* 'the current state of PHP'? Is this information readily obtainable through other means? Would this be better implemented as 'apache_get_uptime()'?

Just points for discussion, I am not going to take any action on it.
 [2005-01-06 00:37 UTC] ceo at l-i-e dot com
Certainly support for more SAPIs would be a Good Thing.

There is probably other information output by phpinfo() that only works on one/some SAPIs...  But perhaps that's confined to the Module sub-sections that only support some SAPIs.

My primary goal is to stop people from asking why their change to php.ini "didn't work"

Many/Most of them check using phpinfo(), and if they had it right in front of them that their SAPI has been running for 2 years, they'd *know* they didn't re-start it...

Actually, how about just this, the exact same on all SAPIs:

Date/time stamp the load-time of php.ini information when php.ini is read.

This achieves the desired goal on all SAPIs/OSes and should be, what?, a line of code to record the date/time in a variable somewhere, and another line of code to print it out later?

Perhaps even make it a sort of 'fake' entry in the ini_get (read only) functions so it can be checked programmatically.

So ini_get('php.ini load_time') would return the date/time php.ini got loaded.

Just thinking aloud here...
Sorry if this should have run by php-dev first.
Seemed so simple when I first posted. :-)
 [2005-01-06 00:39 UTC] ceo at l-i-e dot com
Perhaps it should be called "PHP up-time"

Since that is what it truly is measuring/recording.
 [2005-01-11 14:02 UTC] magnus@php.net
A patch was submitted and not accepted.
You can use the apache module mod_status to see apache uptime.

http://news.php.net/php.internals/14304
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 16 16:01:34 2024 UTC