422,751 Members | 2,036 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 422,751 IT Pros & Developers. It's quick & easy.

PHP fatal error : Class perl not found

P: 2
Hi,

I have searched around for the solution to this problem, but I am trying to call a perl script from php, and get a fatal error:Class perl not found

I am using php 5.1.6 and apache 2.0 , php and apache is configured fine, as i am able to run <phpinfo()?> with out any problem. I have added php_perl.dll into my php.ini extensions ... and copied it to php/ext folder.

The scripts are very basic (from the source:http://devzone.zend.com/node/view/id/1712)

test.php:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. print "Hello from PHP! ";
  4. //$erl = new Perl();
  5. //$perl->require("test1.pl");
  6. print "Bye! ";
  7.  
  8. ?>
  9.  
test1.pl:
print "Hello from perl! "


Thanks'

PB
Jul 15 '08 #1
Share this Question
Share on Google+
17 Replies


P: 2
Hi,

I found the solution

I was getting all the steps correct, just made a small path error mistake in the ini file, and damn it took me like 2-3 hours to get to know this...

Now I really know, what all can go wrong when u try php->perl

;)
Jul 15 '08 #2

P: 1
Hi,

I found the solution

I was getting all the steps correct, just made a small path error mistake in the ini file, and damn it took me like 2-3 hours to get to know this...

Now I really know, what all can go wrong when u try php->perl

;)

Hey Prana, can you please explain the steps cause i having exactly the same issue, and i have been looking in the php.ini, added the extension=perl.so

but nothing changed.
Oct 16 '08 #3

P: 12
Hi,

Please if some one could help me out to solve this problem

I have searched around for the solution to this problem, but I am trying to call a perl script from php, and get a fatal error:Class perl not found

I am using php 5.1.6 and apache 2.0 , php and apache is configured fine, as i am able to run <phpinfo()?> with out any problem. I have added perl.so extension into my php.ini extensions

The scripts are very basic (from the source:http://devzone.zend.com/node/view/id/1712)

test.php:
Expand|Select|Wrap|Line Numbers

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. print "Hello from PHP! ";
  4. //$erl = new Perl();
  5. //$perl->require("test1.pl");
  6. print "Bye! ";
  7.  
  8. ?>

test1.pl:
print "Hello from perl! "


Thanks'
May 11 '10 #4

Markus
Expert 5K+
P: 6,050
Do you have the perl extension installed?
May 11 '10 #5

P: 12
@Markus
yes.....I got the extension from this link and followed the steps http://pecl.php.net/package/perl.

and also tried with this command, but got the following error.
root@cogitate-linux2:~# cvs -d :pserver:cvs.php.net:/repository co pecl/perl
cvs checkout: authorization failed: server cvs.php.net rejected access to /repository for user root
cvs checkout: used empty password; try "cvs login" with a real password


and also The file perl.so is empty, if tried to open, it shows the error
Could not open the file /usr/lib/php5/20060613+lfs/perl.so.
There is no application installed for this file type
May 11 '10 #6

Markus
Expert 5K+
P: 6,050
Did you compile the source code?
May 11 '10 #7

P: 12
@Markus
mate......I have installed perl interpreter.......using the link http://pecl.php.net/package/perl.
.....and i included the extension perl.so in the php.ini file. I compiled and run the file in the browser.

This is the code

test1.pl
Expand|Select|Wrap|Line Numbers
  1. print "Hello from perl! "
test1.php
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. print "Hello from PHP! ";
  4. $perl = new Perl();
  5. $perl->require("test1.pl");
  6. print "Bye! ";
  7.  
  8. ?>


and the output is

Expand|Select|Wrap|Line Numbers
  1. Hello from PHP!
  2. ( ! ) Fatal error: Class 'Perl' not found in /var/www/mohan/test1.php on line 4
  3. Call Stack
  4. #    Time    Memory    Function    Location
  5. 1    0.0003    54160    {main}( )    ../test1.php:0
  6.  

This is wat i have edited in the php.ini file

; extension_dir = "/usr/lib/php5/20060613+lfs/perl.so"
extension_dir = "/usr/lib/php5/20060613+lfs/perl.so"
This is the path wher i the perl.so file stored in the directory

; extension=perl.so
extension=perl.so
May 11 '10 #8

Markus
Expert 5K+
P: 6,050
Does your phpinfo() output show that the Perl module is enabled?
May 11 '10 #9

P: 12
@Markus
how to check that?


ya i got it.....it is intalled......


i used

<?php

// Show all information, defaults to INFO_ALL
phpinfo();

// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);

?>

save this prog in file called phptest.php and run in the browser


and also u can check it in command prompt using this command

perl -MTie::Hash -e 1

If you don't get any output from the above command then the module is installed; if you get an error, it's not installed


It is installed.....
May 12 '10 #10

P: 12
after installing the extension, i run the command make test,
but i got this result

Number of tests : 70 70
Tests skipped : 0 ( 0.0%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 70 (100.0%) (100.0%)
Tests passed : 0 ( 0.0%) ( 0.0%)
---------------------------------------------------------------------
Time taken : 4 seconds
================================================== ===================

================================================== ===================
FAILED TEST SUMMARY


what sud i do now to make the test successful
May 12 '10 #11

P: 12
@Markus
re: PHP fatal error : Class perl not found
Does your phpinfo() output show that the Perl module is enabled?

I checked phpinfo(). but i could not find perl module in it.

Loaded Modules : core mod_log_config mod_logio prefork http_core mod_so mod_alias mod_auth_basic mod_authn_file mod_authz_default mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_dir mod_env mod_mime mod_negotiation mod_perl mod_php5 mod_rewrite mod_setenvif mod_status
May 12 '10 #12

Markus
Expert 5K+
P: 6,050
See why the tests failed. You should have logs of the tests in the tests directory.
May 12 '10 #13

P: 12
@Markus
I dont have the logs in tests directory
May 12 '10 #14

P: 12
There's no logs in any of the perl-1.0.0 directories. The directory includes int perl-1.0.0 is empty
May 12 '10 #15

P: 12
Hi,

I have searched around for the solution to this problem, but I am trying to call a perl script from php, and get a fatal error:Class perl not found

I am using php 5.1.6 and apache 2.0 , php and apache is configured fine, as i am able to run <phpinfo()?> with out any problem. I have added php_perl.dll into my php.ini extensions ... and copied it to php/ext folder.

The scripts are very basic (from the source:http://devzone.zend.com/node/view/id/1712)

test.php:
Expand|Select|Wrap|Line Numbers

1. <?php
2.
3. print "Hello from PHP! ";
4. //$erl = new Perl();
5. //$perl->require("test1.pl");
6. print "Bye! ";
7.
8. ?>
9.

test1.pl:
print "Hello from perl! "


Thanks'
May 12 '10 #16

P: 12
I got The solution.

There will be few files which will not be installed while installing the extensions. I tried this, I got the solution....

perl -MCPAN -eshell

and then eg
install Net::LDAP

It is running for me. Thank you Markus for ur concern on me.
May 12 '10 #17

P: 1
pranavb85
"I found the solution

I was getting all the steps correct, just made a small path error mistake in the ini file, and damn it took me like 2-3 hours to get to know this...

Now I really know, what all can go wrong when u try php->perl

;)"

Can you explain more detail hoe you solve the problem?
1 Week Ago #18

Post your reply

Sign in to post your reply or Sign up for a free account.