Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Perl from PHP

by Limbic~Region (Chancellor)
on Nov 07, 2012 at 18:20 UTC ( #1002706=note: print w/replies, xml ) Need Help??

in reply to Perl from PHP

Rather than assume the problem is with PHP posting to a Perl CGI, first verify that you can run a Perl CGI directly. There could be a number of problems - the script doesn't have the correct ownership, permissions, isn't printing out headers, etc. If it were one of those issues - I would expect an error message rather than a white screen. More likely, something isn't working the way you expect and you are looking in the wrong broom closet.

Write the simplest hello world CGI you can. Verify it works directly. Replace the POST action to the hello world. Verify it works.

Cheers - L~R

Replies are listed 'Best First'.
Re^2: Perl from PHP
by fullermd (Priest) on Nov 07, 2012 at 21:05 UTC

    +1 to the above

    Remember, PHP doesn't have anything to do with POST'ing to your perl script. The user's browser posts to your perl script. And really, it doesn't even do that; it POST's to a URL. The browser doesn't know anything about PHP or perl, all it knows is that it has some HTML coming in one side, that tells it to send some HTTP stuff to this other URL.

    So your problem probably is either (a) the perl script not D'ingTRT as a CGI, or (b) the URL you're putting in not going to it. Or possibly a variant of both as (c) the server not being configured to run external CGI's, either where you put it, or anywhere.

    Luckily, they all have the same solution; forget the path you're currently taking to get there (the form), and the current contents of the script (whatever processing on the data). Just replace it with a bog-simple hello-world style script, and fiddle around until you can hit it directly and get the expected output. Then just dropping in the real code and the URL in the form will probably Just Work.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1002706]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2017-05-30 05:01 GMT
Find Nodes?
    Voting Booth?