Downloading, Compiling & Installing |
For basics on downloading, compiling, and installing, please see the
INSTALL/INSTALLATION in the Embperl documentation. Please be sure
to load Embperl at server startup - if you do not, various problems may
result. An exception to that rule is when you have compiled mod_perl with
USE_DSO. In this case you must not load Embperl at server statup,
neither via an use in your startup.pl file, nor via PerlModule from
your httpd.conf.
Is there a binary distribution of Embperl for Unix? | top |
No.
Is there a binary distribution of Embperl for Win32? | top |
Win NT/95/98 binarys for Apache/perl/mod_perl/Embperl are
available from ftp://theoryx5.uwinnipeg.ca/pub/other/ . A
european mirror is at http://www.robert.cz/misc/ .
I want to run Embperl with mod_perl under Apache. In what order should I
do the compiling? | top |
First mod_perl and Apache, then Embperl.
../apache_1.3.0/src/include/conf.h:916: regex.h: No such file or directory Try compiling Embperl again, like this: make DEFS=-DUSE_HSREGEX
I'm trying to build HTML::Embperl, and while running 'make' i get: | top |
cc: Internal compiler error: program cc1 got fatal signal 11
make: *** [epmain.o] Error 1 GCC croaking with signal 11 frequently indicates hardware problems.
See http://www.bitwizard.nl/sig11/
I have a lot of errors in 'make test' from mod_perl when using Embperl | top |
Try recompiling Perl and all modules -- this can sometimes make those
annoying error messages disappear!
How can I prevent 'make test' from running some of the tests? | top |
For
example, I don't allow CGI scripts, so 'make test' fails at CGI. How
do I run just the other tests? Try: $ make test TESTARGS="--help"
# and for just offline and mod_perl:
$ make test TESTARGS="-hoe"
Running 'make test' fails with an error message at loading of Embperl
(even though mod_perl compiled and tested cleanly!) | top |
see "I get symbol ap_* undefined/cannot resolve ap_*"
I get symbol ap_* undefined/cannot resolve ap_* | top |
This can happen when symbols in the Apache binary can not be found or
are not being resolved correctly. Some OS do this (for instance bsdos), and it can also happen if your
Apache binary is set to strip symbol information out from binaries. Try: | 1.) make clean | | 2.) perl Makefile.PL | | NOTE: answer _no_ to mod_perl support. (This is important!) |  | | 3.) make test |
If that works, it means that your installation of Embperl is OK,
but is having problems resolving symbols with Apache. Try rebuilding Apache and mod_perl from scratch, and make sure
you do not strip symbols out of either. On some systems/linker you need to tell the linker explicitly to
export such symbols. For example FreeBSD linker needs the
-export-dynamic option. If you don't succeed with this approach, try statically linking
Embperl to Apache/mod_perl (please see the next question for
step-by-step instructions on how to do this).
How can I build a statically-linked copy of Embperl with mod_perl
support? | top |
| 1.) go to your mod_perl directory, change to src/modules/perl and edit the
Makefile so that it contains the line | | #STATIC_EXTS = Apache Apache::Constants HTML::Embperl |  | | 2.) add a definition for EPDIR and change the ONJ= line so that it looks
like this: | | EPDIR=/usr/msrc/embperl
OBJS=$(PERLSRC:.c=.o) $(EPDIR)/Embperl.o $(EPDIR)/epmain.o $(EPDIR)/epio.o
(EP DIR)/epeval.o $(EPDIR)/epcmd.o $(EPDIR)/epchar.o $(EPDIR)/eputil.o |  | | 3.) go to the mod_perl directory and run | | perl Makefile.PL |  | | 4.) go to the Embperl directory and do | | make clean
perl Makefule.PL
make (to compile in mod_perl support) |  | | 5.) go back to the mod_perl directory and remake Apache by typing | | make Now you have successfully built a httpd with statically-linked Embperl. NOTE: If you want to stop here, you can skip to step 11. and run a 'make
install' in the Embperl directory to finish. But if you want to run Embperl tests and/or if you want to be able to use
Embperl in offline or "vanilla" CGI mode, we need to continue: |  | | 6.) go back to the Embperl directory | | 7.) backup the file test/conf/config.pl | | 8.) now build Embperl again but _without_ mod_perl support | | make clean
perl Makefile.PL
make |  | | 9.) restore your saved config.pl to test/conf/config.pl | | (without this step, only the offline mode would be tested) |  | | 10.) run 'make test' for Embperl | | 11.) do 'make install' for Embperl |
NOTE: You should do it in this order, or it may not work. NOTE: It seems to be necessary to load Embperl at server startup,
either by PerlModule or in a PerlScript. See next
question on how to do this.
How do I load Embperl at server startup? | top |
You can load Embperl at server startup by PerlModule or in a startup.pl: NOTE 1: Either of these approaches can often 'fix' SIGSEVs in any mod_perl
handler, not just Embperl. NOTE 2: When mod_perl is compiled as loadable module (i.e. with USE_DSO)
you must not load Embperl at server startup time!
make test fails with a SIGxxxx, how can I obtain a stack backtrace
from gdb? | top |
The eaiest way is make install -> if Embperl is installed, it's easier
gdb perl -> start the debugger with perl binary
set args test.pl -> set the arguments for perl
r -> start the program
-> Here you should receive the signal
share -> makes sure all symbols are really loaded
bt -> show the backtrace To get some more information it would be a good idea to compile Embperl with
debugging infomation enabled. Therefor do
How do I build Embperl with debugging informations | top |
| edit the Makefile | | search for the line starting with 'CC = ' add the -g switch to the end of the line | | search for the line starting with 'LDDFLAGS = ' add the -g switch to the end of the line | | type make to build Embperl with debugging infomation |
now start the gdb as decribed before.
make test fails with SIGXFSZ | top |
This may occur when the filesize limit for the account, either test
is running as or the test httpd, is too small. Embperl make test
generates a really large logfile! Yu must increase the filesize limit
for that accounts.
>From Red Plait My OS is SCO Unix 3.2v4.2, Apache 1.3.4, perl 5.004_4, mod_perl 1.18 and
Embperl-1.1.1 I done following: | 1) | | I made HTML-Embperl-1.1.1 with no mod_perl support ( when I builded it
with mod_perl 1.18 I can`t link it because it don`t finds ap_XXX functions.
When I manually insert src/main/libmain.a from Apache 1.3.4 I got message
"Symbol main is multiple defined in /src/main/libmain.a. and perlmain.o"
). Then I "make test" - all tests was O`k. After this I "make clean", "perl
Makefile.pl" with mod_perl support and "make install" |  | | 2) | | I installed mod_perl and "perl Makefile.PL", then "make" |  | | 3) | | because I have`nt dynamical loading ( very old and buggy OS ) I had to
manually change src/modules/perl/perlxsi.c to insert bootstraps function`s
and it`s invocations and also /src/Makefile to manually insert libXXX.a
libraries |  | | In access.conf I insert code: | | PerlModule HTML::Embperl
<Directory /my_dir>
SetHandler perl-script
PerlHandler HTML::Embperl::handler
</Directory> |  |
Embperl and mod_perl on AIX | top |
You need at least mod_perl 1.22. For mod_perl 1.22 and higher Embperl
should compile out of the box on AIX. If you run into problems with
undefined symbols (like ap_* ) make sure you have the newest
mod_perl version (as of this writing this is mod_perl 1.24_01).
Embperl does not write to the logfile, because of missing permissions
of the user Apache runs as. | top |
The apache server is started as root, then set the effective uid to
user "www", who can then write to the embperl logfile (owned by root)
file handle
that is passed along. However, if this log file handle is later
accidentally
closed, then reopen, the www user would have problem writing to it? The reopen is only done when the logfile name changes. As log as you don't
change the name on the logfile, the logfile will stay open. The problem (in this case) is, that Embperl init function ,(Init in epmain.c)
calls OpenLog will an second argument of zero. Which will only save the
filename. The log will actually opened on the first write to it (or at the
start of the first request). At this time your Apache has alreay switch to
user www. This is done to allow to change the logfile name before an
request, but after the init is already called (which is done when you or
Apache "use" the module) The current solutions is to
write something to the log, before Apache changes it's user (i.e. in the
startup.pl)
Is it possible to install EmbPerl into a private directory on my Unix/Linux Internet Service Provider account of which I have no root privilege? | top |
Like any other Perl module it can. Read "perldoc ExtUtils::MakeMaker",
to see which parameters are needed for Makefile.PL to change the installation
directory. Additionally, you have to change the @INC path to contain your
private directory and possibly paths to other object files. Here are the brief details: Requirements: | At least Perl 5.004_04 | | cc or gcc (your isp must give you access to the gcc compiler) | | URI | | MIME::Base64 | | HTML::Parser | | HTML::HeadParser | | Digest::MD5 | | libnet | | libwww | | File::Spec (I believe you may have to install this too if you are using Perl 5.004_04 as it may not be a standard module) |
Direction: | Get your copy of EmbPerl (HTML-Embperl-x.x.tar.gz) | | % tar -xvzf HTML-Embperl-x.x.tar.gz | | % cd HTML-Embperl-x.x | | % perl Makefile.PL PREFIX=/to/your/private/dir | | % make | | % make test | | % make install |
Replace /to/your/private/dir with the path to the directory you want the module to be placed in. Now preface your CGI scripts with something like this: [Alternative 1] #!/usr/bin/perl -wT
use CGI::Carp qw( fatalsToBrowser ); #recommend using this to report errors on die or warn to browser
use lib '/to/your/private/dir/lib'; #for FILE::Spec
use lib '/to/your/private/dir/'; #to find Embperl
use lib '/to/your/private/dir/i386-linux/auto/HTML/Embperl'; #to find Embperl compiled stuff
#if for some very weird reason the above 'use lib' pragma directive doesn't work, see Alternative 2
use HTML::Embperl;
#your code below ... [Alternative 2] #!/usr/bin/perl -wT
use CGI::Carp qw( fatalsToBrowser ); #recommend using this to report errors on die or warn to browser
BEGIN {
unshift @INC, '/to/your/private/dir/lib'; #for FILE::Spec
unshift @INC, '/to/your/private/dir/'; #to find Embperl
unshift @INC, '/to/your/private/dir/i386-linux/auto/HTML/Embperl'; #to find Embperl compiled stuff
}
use HTML::Embperl;
#your code below ... When you make test, you may encounter superfluous warnings, you may want to change the test.pl that ships with EmbPerl from BEGIN
{
$fatal = 1 ; to BEGIN
{
unshift @INC, '/to/your/private/dir/lib';
$fatal = 1 ;
... because the test.pl may not be able to find FILE::Spec if you have it installed on a private directory for Perl 5.004_04. Do something similar to the important file embpcgi.pl as you do for all your CGI scripts, like modifying the @INC as shown above, to allow perl to find in particular the EmbPerl shared obj files... And when you invoke your CGI scripts like so, http://www.yourdomain.com/cgi-bin/embpcgi.pl/templateFiles/myNifty.epl the script should work.
|