Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
brentnhunter
Client



Joined: Sep 10, 2004
Posts: 166

PostPosted: Thu Oct 28, 2004 7:46 am Reply with quote

Does anyone know the process and syntax for calling a perl script from within a phpnuke page or module? And where the perl script must be located on the server in order for it to be accessible from that page?

Thanks for any help anyone can provide.

Cheers,

Brent Hunter
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Thu Oct 28, 2004 9:59 am Reply with quote

Although it can be called from anywhere, most people put the script in their CGI folder and just call it like any other hyperlink.
 
View user's profile Send private message
brentnhunter







PostPosted: Thu Oct 28, 2004 11:14 am Reply with quote

Raven wrote:
Although it can be called from anywhere, most people put the script in their CGI folder and just call it like any other hyperlink.


Raven,

Thanks... if I want the output of the perl code to be included as part of the web page, don't I have to include as an SSI or something like that? If so, how would I accomplish that?

Thank you!

Brent
 
Raven







PostPosted: Thu Oct 28, 2004 5:14 pm Reply with quote

I hesitated about answering this, especially because you're on my server Wink

Here would be an example
Code:
<?php

$output = `ls -al`;
echo "<pre>$output</pre>";
?>

You execute the command with the backtick operator-> `

Read up on it at [ Only registered users can see links on this board! Get registered or login! ]

Note all the warnings.
 
brentnhunter







PostPosted: Thu Oct 28, 2004 5:39 pm Reply with quote

Thanks very much. I've read the link you advised, and I'll be very careful using it.

Brent
 
brentnhunter







PostPosted: Thu Oct 28, 2004 8:28 pm Reply with quote

Gaylen,

I am trying to run a little perl script on one of my web pages that outputs text, and I would like that text to be part of the HTML that is generated as part of that page. I have included the following in one of my phpnuke pages:

$output = `./urlrand.cgi`;
echo "$output";
echo "After CGI call";

Although it prints the first part of the page and the "After CGI call" text, it doesn't output anything when it calls the program.

The first line of my perl script is:

#!/usr/bin/perl

Is that the correct location for perl on your server?

FYI, the php file and the cgi file are both located in the same directory.

Any ideas why it isn't doing anything? And yes, I set the permissions on the urlrand.cgi file to 755 to make it executable.

Thank you for any help you can provide!

Brent
P.S. This isn't the script we discussed this morning, this one performs a different function.
 
Raven







PostPosted: Thu Oct 28, 2004 8:33 pm Reply with quote

The path is correct. Check your error log incPanel to see if there's an error.
 
brentnhunter







PostPosted: Thu Oct 28, 2004 8:42 pm Reply with quote

Hmmm, what might cause this? I was getting these errors earlier in the day; I only started testing my perl script a while ago so it can't be related to the script:

[Thu Oct 28 12:47:21 2004] [error] [client 167.6.245.98] File does not exist: /home/earthlh/public_html/earthcommcenter/404.shtml
[Thu Oct 28 12:47:21 2004] [error] [client 167.6.245.98] File does not exist: /home/earthlh/public_html/earthcommcenter/transparent

I am also looking at another error that is caused by the script. Something about headers, I'm looking into it now.
 
brentnhunter







PostPosted: Thu Oct 28, 2004 8:45 pm Reply with quote

OK I got rid of the header error, it was trying to output a header twice. However I am now getting the error I referred to above:

[Thu Oct 28 21:43:19 2004] [error] [client 67.174.196.221] File does not exist: /home/earthlh/public_html/earthcommcenter/404.shtml
[Thu Oct 28 21:43:19 2004] [error] [client 67.174.196.221] File does not exist: /home/earthlh/public_html/earthcommcenter/transparent

Any more recommendations?

Brent
 
Raven







PostPosted: Thu Oct 28, 2004 8:55 pm Reply with quote

The error is just what it says. 2 files are being called that don't exist. Find what scripts are calling them. The 404.shtml is an error script that you can just make up to be displayed when a file is not found. Probably in cPanel you have directed it to that and never put it there. The other appears to be a result of a script that you are running.
 
brentnhunter







PostPosted: Thu Oct 28, 2004 9:03 pm Reply with quote

I never set anything to do with error pages. I went in to cpanel and only saw what appear to be default setting for a handful of different errors.

These errors were taking place earlier today (in addition to now), when I didn't even have the script loaded onto the server so something else must be generating those errors. I will have to go to various aread of my site, check the error log, and see what is generating the error.

But back to my question on the script, my script doesn't call any of the missing files and I'm still not sure why it isn't working?

Brent
 
brentnhunter







PostPosted: Thu Oct 28, 2004 9:56 pm Reply with quote

Very strange, I am getting these two errors every time I go to the front page of my site!
[ Only registered users can see links on this board! Get registered or login! ]

(*scratching head*)
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©