Running perl from php page ??

gontham

New Member
Messages
2
Reaction score
0
Points
0
Hello,

i am trying to call my perl script from a php page, the perl script works fine when i call it from the browser, but when i call it from my test.php page i get this error:

Fatal error: Class 'Perl' not found in /home/a8346115/public_html/test.php on line 43


I read that i should install the perl extension for php but that requires me to change the php.ini file, which i don't seem to have access to.

i am calling the script with this:

<?php

print "Hello from PHP! ";
$perl = new Perl();
$perl->require("./cgi-bin/test.pl");
print "Bye! ";

?>

Any help would be appreciate it,
Thank you
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
the phpinfo() function is currently disabled, so I can't check if the perl extension is installed. Right now, I believe it isn't. You're right about installing it, only an admin who has access to php.ini and the php installation directory can fix this.
 
Last edited:

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
What you could do, is use cURL or url_fopen to get the output of the script and then print it.

I know it's not the best option, but since you have no access to the php.ini file.

Finally, when you post source code in these forums, enclose it within
Code:
, [php] or [html] tags (whichever is most appropriate) to make it easier to read.
 
Last edited:

nirajkum

New Member
Messages
159
Reaction score
0
Points
0
Set the perl path . As it is not able to find the perl and enable the phpinfo() function
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
Set the perl path . As it is not able to find the perl and enable the phpinfo() function

the PHP perl class and the phpinfo() function are set at the admin level and can't be changed by users. It is giving an error before it even tries to find the perl file.
 
Top