Article View: comp.misc
Article #149Re: PHP2Shell
From: Richard Kettlewell
Date: Tue, 27 Oct 2026 08:24
Date: Tue, 27 Oct 2026 08:24
52 lines
3213 bytes
3213 bytes
noel <deletethis@invalid.lan> writes:
> Computer Nerd Kev wrote:
>> It's fixed by running "apache2ctl stop", then "apache2ctl start",
>> instead of "apache2ctl restart". Or rebooting. Unfortunately Apache
>> probably remains vulnerable to PHP2Shell until you do that.
>
> I would expect restart to restart for something like that as apache will
> not reload the newbie without it as you found out, i cant check reliably
> now, since freepbx had a few security updates that restarted the server,
> but that was 18hrs after /shrug/
>
> I see debian use their own custom apachectl, not the same as upstream but
> doesnt appear to do any harm at a quick look, just checked fpbx's php
> info page, says 8.2.35 so is running correct mod_php
Debian’s apachectl handles restart as follows:
case "$ARGV" in
restart|graceful)
if $HTTPD ${APACHE_ARGUMENTS} -t 2> /dev/null ; then
$HTTPD ${APACHE_ARGUMENTS} -k "$ARGV"
else
$HTTPD ${APACHE_ARGUMENTS} -t
fi
ERROR=$?
;;
i.e. it syntax checks the configuration and then runs apache2 -k restart.
https://httpd.apache.org/docs/current/stopping.html#hup describes the
effect of this option:
apachectl -k restart
Sending the HUP or restart signal to the parent causes it to kill
off its children like in TERM, but the parent doesn't exit. It
re-reads its configuration files, and re-opens any log files. Then
it spawns a new set of children and continues serving hits.
i.e. in Apache speak, “restart” doesn’t actually mean restarting the
server at all, at least in the common sense of restart meaning stop and
then start from scratch.
What that means for PHP configuration lingering past one of this fake
restarts I couldn’t say, but it does make the behavior CNK reports
completely unsurprising.
systemctl restart should actually restart the server.
--
https://www.greenend.org.uk/rjk/
Technical Details
Message-ID:
<wwvv76nd00g.fsf@LkoBDZeT.terraraq.uk>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nntp.terraraq.uk!.POSTED.tunnel.sfere.anjou.terraraq.uk!not-for-mailReferences:
<6ad93fa7@news.ausics.net> <6add4482$1@news.ausics.net> <6add5a32@news.ausics.net> <6addd8f7$1@news.ausics.net> <6adeaee2@news.ausics.net> <6ae039e7$1@news.ausics.net>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nntp.terraraq.uk!.POSTED.tunnel.sfere.anjou.terraraq.uk!not-for-mail
From: Richard Kettlewell <invalid@invalid.invalid>
Newsgroups: comp.misc
Subject: Re: PHP2Shell
Date: Tue, 27 Oct 2026 08:24:15 +0000
Organization: A poorly-installed InterNetNews site
Message-ID: <wwvv76nd00g.fsf@LkoBDZeT.terraraq.uk>
References: <6ad93fa7@news.ausics.net> <6add4482$1@news.ausics.net>
<6add5a32@news.ausics.net> <6addd8f7$1@news.ausics.net>
<6adeaee2@news.ausics.net> <6ae039e7$1@news.ausics.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: innmantic.terraraq.uk; posting-host="tunnel.sfere.anjou.terraraq.uk:172.17.207.6";
logging-data="11198"; mail-complaints-to="usenet@innmantic.example.com"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:J2MgHGzBc5ezGx/ERuPm66W6bEo=
X-Face: h[Hh-7npe<<b4/eW[]sat,I3O`t8A`(ej.H!F4\8|;ih)`7{@:A~/j1}gTt4e7-n*F?.Rl^
F<\{jehn7.KrO{!7=:(@J~]<.[{>v9!1<qZY,{EJxg6?Er4Y7Ng2\Ft>Z&W?r\c.!4DXH5PWpga"ha
+r0NzP?vnz:e/knOY)PI-
X-Boydie: NO