You have got a couple of options, but none of them are good!

  1. you can get perl to execute a PHP script using the standalone CGI version of PHP and do something with the results that it generates (this will only allow you to parse and alter the output of the PHP program, it won't actually let you call a PHP function).
  2. You can use Apache2 and mod_perl2 which allow you to write a mod_perl Filter that can filter the output of mod_php (again, it is only working on the output generated by PHP)
  3. A quick search on CPAN for PHP found PHP::Include. This module claims to be able to parse very simple PHP, and convert it to perl code. So depending on how complex your PHP is, it might be an option.
  4. Convince someone to write Inline::PHP... Good luck with that one, since I don't think there would be much demand for that.
  5. Without knowing how extensive the code is that you would like to run, my recommendation would be to rewrite your PHP in perl. PHP doesn't do anything that perl can't do...

    - Cees


    In reply to Re: use php objects from within mod_perl by cees
    in thread use php objects from within mod_perl by imcsk8

    Title:
    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post, it's "PerlMonks-approved HTML":



  6. Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  7. Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  8. Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  9. Please read these before you post! —
  10. Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  11. You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  12. Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  13. See Writeup Formatting Tips and other pages linked from there for more info.