I tried executing a perl script within a PHP script by using SYSTEM function and the like but it seems that I can't executed that Perl script. Btw, the file permission for my Perl script is -rwxr-xr-x and is located in my cgi-bin directory. What's wrong with my scripts? Please help.. me.. Thanks!!

By the way, thanks for all the replies to my previous postings.. GOD Bless

Juney

    I tried all of this functions but nothing seems to work.. actually, my perl script writes to a logfile everytime i executed it.. but, nothing is log to the logfile when I call the script within the php3 script.

    Can you help me with my Perl question? Is runnning a perl script via a shell different from calling a script via a http connection with regards to thier UID? I know that running perl in shell is ROOT but what about those that are executed via a http_connection?

    THANKS!
    Juney

      a year later

      I'm having the same problem. I can't figure out why I'm not able to run a Perl script through a PHP page. Can someone please help?

      Thanks

        6 days later

        webgirl,

        I think you should allow the UID your http server is running to execute the
        perl script... you can do this by chown or chmod. NOTE that is is very risky..!!

          Thanks for the advise Jun.
          I have the Perl script chmoded to 755, which is (read,write,execute - read,execute - read,execute). The owner is chowned to me as it should be.
          And the Perl script executes correctly from the command line.
          And it still won't work through a PHP page.
          Any other suggestions?

            a year later

            well, mine.... what i did is...

            If i have a perl script named... runme.pl
            and i want to execute that within my php script.. via exec or system call... i do this..

            get the group where your apache's userid belongs... for me.. my apache server has a UID:apache and GID:apache
            so what i do is to chown the file..

                chown juney.apache runme.pl

            and then chmod the file so that, only me and apache can execute that file...

              chmod go-rx  runme.pl
              chmod gu+rx runme.pl

            i know there's another way to do that using SuEXEC
            but i dont know how to use it..

              Write a Reply...