Apache requires manual restart before recognizing PHP

By Neon Samurai ·
I thought I had this figured out but low and behold, the server gets a reboot and when it comes back up Apache is again trying to send .php to the browser as a download file rather than processing too html on the server side.

Currently, the server recognizes the php files only after manually restarting it (apachectl restart or /etc/init.d/httpd restart). The PHP module is in place and seem to work perfectly after the restart but I can't figure out why this is not working after the server starts during boot.

I see it as a huge security hole in addition to being a downright pain for the local admin (most tech literate person at that location).

Has anyone seen this anomaly before?

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

Different config?

by deity_chooch In reply to Apache requires manual re ...

I have never heard of this before and the only thing that I could think to look for is a different startup script that uses a different configuration file. The only way I can see that happening is if you created the startup script yourself, or edited it afterward.

Collapse -

I was thinking that.. no such luck though

by Neon Samurai In reply to Different config?

I checked for a different config but the startup script is stock out of the package and the 70_mod_php is only what the package dropped in.

One correction on my part, if the server is restarted from apachectl (restart or graceful) it looses php support but if I'm less gentle and kick it over with a direct /etc/init.d/httpd restart then it recognizes the php support. very strange.

I've had little luck with the apache forums and google so far.

Collapse -

Hmm... apachectl script?

by deity_chooch In reply to I was thinking that.. no ...

I haven't really used apachectl much so I'm not quite sure, but is there a configuration file for it? Or is it itself a script or a binary? I'm thinking that if it has a configuration file of its own or if it is itself a script, there might be a variable in it that is using an incorrect or missing Apache configuration file.

I know it's a long shot, but that's about all I can pull out of this head of mine.

Collapse -

Checking apachectl now

by Neon Samurai In reply to Hmm... apachectl script?

It's meant to stop, start and restart apache between browser requests rather than simply cutting off any current connections.

Turns out it is a script rather than binary. I'm not seeing a config file specification in the code. I'll have a read through it in more detail though and can post it up if it's of interest.

Collapse -

config file

by Jaqui In reply to Checking apachectl now

is specified in the apache binary, or, you can pass an argument to it with a config file specified.

easier to just copy original config out and put a different one in to test it.

Collapse -


by Jaqui In reply to Apache requires manual re ...

what version of Apache and what version of PHP?
[ fwiw there hasn't been anything on his subject in the Apache email support list, though most often they say it's php itself there. ]

and what distro is the system running that this is happening on?

I can check to see if I can duplicate the problem and figure it out.

Collapse -


by Neon Samurai In reply to ok

I was going to say trying to recreate the issue is pretty hard core but I'm known to cut a VM on a whim. I have to have a read through the apachectl script (another executable turns out to be scripting.. I love *nix).

Mandriva 2007.1
Apache mpm prefork 2.2.4-6.3mdv
Apache mod_php 5.2.1-4mdv

Files are transfered to the websites through ftp inside the firewall. httpd seems to need a restart after php files are uploaded.

Files under the /var/www/html/sites use a common group to allow Apache access and user specific owners bound to ftp accounts for seporation of management. I don't see how the own:grp would cause this but I include it just encase.

(It should be a debian box I know but Mandriva meant the drake tools for the local Admin who's previously only worked with windows boxes.)

I guess I'll be watching my logs a little closer now that I've blown the advantage of removing versions from my deamon headers.

Anyhow, I'd love to figure out what I'm missing here. It worked perfectly during the development build then borked when I whiped the server for a clean final build.

Collapse -

that is enough to tell me

by Jaqui In reply to Details

you really made some alterations to the config somewhere.

I just took Mandriva 2007 off one system and put 2008 on it, before seeing this question at all.
on both, adding apache and php through the installer with the os and php scripts all run fine, even when I use ftp to "upload" on my internal network.

send me a peermail, I'll send the apachectl and httpd.conf I have that are working.
Then you can verify that it is or isn't either of them.

Apache 2.2.6-8mdv2008.0
mod_php Version: 5.2.4-2mdv2008.0
PHP Version: 5.2.4-2mdv2008.0

are what is currently installed.

edit to add:
I save myself time and keep my conf files when I put a new version of the os on, copying them over is faster than editing them to get the settings the way I want. My conf files all came from Mandriva 2006 for my Mandriva system, they still work. :)

Related Discussions

Related Forums