Page 1 of 1

php running perl command

Posted: Mon Jul 25, 2005 3:03 pm
by pharrell84
Hello,

I am currently working on a php page which allows users to add/delete/view extensions from a PBX (Asterisk) by changing the .conf files. The process for adding one involves adding values to a mysql database in the php code, then running a .PL file with perl to look at the database, and create the appropriate code in the .conf files for Asterisk to read...

Well I have written the code and the database is loading up fine, and I can even type the command "perl -T ~/Desktop/.../retrieve_sip_conf_from_mysql.pl" manually and it churns out the .conf files just perfectly. The problem comes in when I want the php page to run this PL file at the end of an added extension. I have tried a few functions and currently have it as

Code: Select all

system(&quote;perl -T ~/Desktop/.../retrieve_sip_conf_from_mysql.pl&quote;);
but none (including this one) seems to work, the conf files are not created. I have a feeling it may be related to permissions somewhere? I have made them as flexible as possible on perl and all conf files involved but still nothing.

Is there perhaps another command to use when running perl in this manner?

Thanks for any help.

Posted: Mon Jul 25, 2005 4:46 pm
by pickle
You need to consider the rights of the user running the script. It may work fine when running it as your user, but what can the 'apache' user do?