PHP fatal error : Class perl not found

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pranavb85
    New Member
    • Jul 2008
    • 2

    PHP fatal error : Class perl not found

    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:
    [code=php]
    <?php

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

    ?>
    [/code]
    test1.pl:
    print "Hello from perl! "


    Thanks'

    PB
    Last edited by Atli; Jul 15 '08, 06:19 PM. Reason: Added [code] tags
  • pranavb85
    New Member
    • Jul 2008
    • 2

    #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

    ;)

    Comment

    • khalistoo
      New Member
      • Oct 2008
      • 1

      #3
      Originally posted by pranavb85
      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.

      Comment

      • smohan
        New Member
        • May 2010
        • 12

        #4
        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|W rap|Line Numbers

        Code:
        <?php
        
        print "Hello from PHP! ";
        //$erl = new Perl();
        //$perl->require("test1.pl");
        print "Bye! ";
        
        ?>

        test1.pl:
        print "Hello from perl! "


        Thanks'
        Last edited by Dormilich; May 11 '10, 07:30 PM. Reason: Please use [code] tags when posting code

        Comment

        • Markus
          Recognized Expert Expert
          • Jun 2007
          • 6092

          #5
          Do you have the perl extension installed?

          Comment

          • smohan
            New Member
            • May 2010
            • 12

            #6
            Originally posted by Markus
            Do you have the perl extension installed?
            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.ph p.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

            Comment

            • Markus
              Recognized Expert Expert
              • Jun 2007
              • 6092

              #7
              Did you compile the source code?

              Comment

              • smohan
                New Member
                • May 2010
                • 12

                #8
                Originally posted by Markus
                Did you compile the source code?
                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
                Code:
                print "Hello from perl! "
                test1.php
                Code:
                <?php
                
                print "Hello from PHP! ";
                $perl = new Perl();
                $perl->require("test1.pl");
                print "Bye! ";
                
                ?>


                and the output is

                Code:
                Hello from PHP!
                ( ! ) Fatal error: Class 'Perl' not found in /var/www/mohan/test1.php on line 4
                Call Stack
                #	Time	Memory	Function	Location
                1	0.0003	54160	{main}( )	../test1.php:0

                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
                Last edited by Dormilich; May 11 '10, 07:32 PM. Reason: Please use [code] tags when posting code

                Comment

                • Markus
                  Recognized Expert Expert
                  • Jun 2007
                  • 6092

                  #9
                  Does your phpinfo() output show that the Perl module is enabled?

                  Comment

                  • smohan
                    New Member
                    • May 2010
                    • 12

                    #10
                    Originally posted by Markus
                    Does your phpinfo() output show that the Perl module is enabled?
                    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_MO DULES);

                    ?>

                    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.....

                    Comment

                    • smohan
                      New Member
                      • May 2010
                      • 12

                      #11
                      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

                      Comment

                      • smohan
                        New Member
                        • May 2010
                        • 12

                        #12
                        Originally posted by Markus
                        Does your phpinfo() output show that the Perl module is enabled?
                        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_defau lt mod_authz_group file 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

                        Comment

                        • Markus
                          Recognized Expert Expert
                          • Jun 2007
                          • 6092

                          #13
                          See why the tests failed. You should have logs of the tests in the tests directory.

                          Comment

                          • smohan
                            New Member
                            • May 2010
                            • 12

                            #14
                            Originally posted by Markus
                            See why the tests failed. You should have logs of the tests in the tests directory.
                            I dont have the logs in tests directory

                            Comment

                            • smohan
                              New Member
                              • May 2010
                              • 12

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

                              Comment

                              Working...