[prog] Calling a perl program from within PHP

Gareth Anderson somecsstudent at gmail.com
Tue Nov 16 13:48:59 EST 2004


> Have you checked your webserver logs?   That's the first thing I
> suggest that my students try. :)  Oftentimes, there are error messages
> there that'll help a bunch.

I'm not sure if I get access to those....

I did try simpler scripts and they work fine.

I thought about it and it clicked, the program will fail because its
trying to access stuff as user "www", while the folder is accessible
to user gja.

I messed around with permissions a bit, if I let the script get run by
the webserver, its owner is "www" and group is "www". -- this was bad
because to let the script read/write it let other people download it.

If I run it manually first, the user is "gja" and group "www", so I
ended up using setuid bit, which is insecure but it works.

I also started adding a tiny amount of security to the PHP script
(escapeshellargs()) and stuff to make it harder to break things.

Its not 100% secure but it should work...

Regards,
Gareth


More information about the Programming mailing list