[Wolves] PHP

Jon Farmer jonfarmer at enta.net
Mon Aug 16 09:51:00 BST 2004

trig wrote:

> I wasn't sure what to put as the subject so I thought PHP was good enough. I 
> 've been asked to create a PHP UI for a system. Sounds easy enough, one of 
> the hard things tho, is this.. I need to be able to read/write files 
> contained in /etc
> Seeing as most of these files are 'root' owned its gonna be hard for me to 
> just
> fopen("/path/to/file",a+);
> Is there anyway that anyone knows of, that would allow me to read/write to 
> these files without changing too much on the server side of things?

Three ways of doing this come to mind,

1. Use PHP as a CGI and run via Apache Suexec

2. Record all settings in a database and write CLI PHP cron'd as root 
(or user with sufficient privilege) to reconfigure server.

3. Postfix, Bind, ProFTPD can all be configured direct from MySQL these 
days so if you need these services this is the way to go.

Jon Farmer
Systems Programmer
Entanet International Ltd
GPG Fingerprint ABCB 6E92 59B8 001F FE9C  0817 A2D6 0151 FF49 9040
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : http://mailman.lug.org.uk/pipermail/wolves/attachments/20040816/f1190aa9/signature-0001.bin

More information about the Wolves mailing list