Forum Moderators: coopster & phranque

Message Too Old, No Replies

Execute remote files with chmod to owner only

         

SillyMary

12:19 pm on Jan 27, 2006 (gmt 0)

10+ Year Member



Hi,

Is it possible to execute a (PHP) script on a webserver from within a local perl script?

The webserver I'm working on does not allow CGI scripting, so I'm using a PHP script to insert some things into my MySQL database. And because I do not want other people to insert things into that database I'm the only person allowed to run that script.

I want to run the PHP script from within a perl script on my local computer. Is there a way to do that? I have to log in I assume (because of the permissions) and run it.

Anyone suggestions?
Thanx

simon2263

12:43 pm on Jan 27, 2006 (gmt 0)

10+ Year Member



Personally, I think it would be simpler to have the PHP script run under a webserver and use .htaccess to restrict who can run it. Then the Perl script can just use LWP to act as a client program to request the PHP script.

SillyMary

2:16 pm on Jan 27, 2006 (gmt 0)

10+ Year Member



Hi,

Thanx for your answer.

I don't know If I'm allowed to use .htaccess on that webserver. I'm going to find out.

I don't know exactly how .htaccess works, but if you specify which people may use the script I can imagine you still must authenticate when using LWP? Can you give a short example?

And what if I'm not allowed to use .htacces? Is there perhaps another way to run the script safely?

Thanx.