Nun, ich habe eine Fehlermeldung „install_driver(Pg) failed:Kann version.pm nicht finden bekommen ” beim Starten des OpenCA 1.5.1-Daemons auf CentOS. In diesem Tutorial wird erklärt, wie der OpenCA-Startfehler behoben wird. Version.pm kann nicht gefunden werden. Bevor ich auf die Lösung spreche, sehen Sie sich die vollständige Fehlermeldung an.
OpenCA-Daemon starten:
# ./etc/init.d/openca start
Obwohl der obige Befehl keine Meldung auslöste, konnte ich einen detaillierten Fehler in var/openca/log/stderr.log
finden . Unten ist der Schnappschuss davon.
install_driver(Pg) failed: Can't locate version.pm in @INC (@INC contains: /home/openca/lib/openca/perl_modules/perl5/x86_64-linux-thread-multi /home/openca/lib/openca/perl_modules/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /home/openca/lib/openca/perl_modules/perl5/x86_64-linux-thread-multi/DBD/Pg.pm line 19. BEGIN failed--compilation aborted at /home/openca/lib/openca/perl_modules/perl5/x86_64-linux-thread-multi/DBD/Pg.pm line 19. Compilation failed in require at (eval 288) line 3. Perhaps a module that DBD::Pg requires hasn't been fully installed at /home/openca/lib/openca/perl_modules/perl5/OpenCA/DBI.pm line 914. Compilation failed in require at /home/openca/etc/openca/openca_start line 66.
Die Fehlermeldung zeigt an, dass version.pm
nicht gefunden werden konnte Datei und vielleicht ein Modul, das DBD::Pg
wurde nicht vollständig installiert. Lassen Sie uns DBD::Pg
installieren .
Installieren Sie DBD::Pg mit cpan
cpan[1]> install DBD::Pg
Jedoch cpan
Installation von DBD::Pg
fehlgeschlagen und mit der folgenden Fehlermeldung beendet.
Could not load DBI::DBD - is the DBI module installed? No 'Makefile' created'YAML' not installed, will not store persistent state TURNSTEP/DBD-Pg-3.7.4.tar.gz /usr/bin/perl Makefile.PL -- NOT OK Running make test Make had some problems, won't test Running make install Make had some problems, won't install Could not read metadata file. Falling back to other methods to determine prerequisites Failed during this command: TURNSTEP/DBD-Pg-3.7.4.tar.gz : writemakefile NO -- No 'Makefile' created
Also musste ich DBI::DBD
installieren -Modul, bevor Sie DBD::Pg
installieren . Lassen Sie uns fortfahren und DBI::DBD
installieren
DBI::DBD installieren
cpan> install DBI::DBD Appending installation info to /usr/lib64/perl5/perllocal.pod TIMB/DBI-1.640.tar.gz /usr/bin/make install -- OK
Ja, ich habe jetzt DBI::DBD
installiert Modul, wiederholen wir DBD::Pg
Installation über cpan
.
cpan> install DBD::Pg
Ah! ein weiterer Fehler:
cp lib/Bundle/DBD/Pg.pm blib/lib/Bundle/DBD/Pg.pm cp Pg.pm blib/lib/DBD/Pg.pm /usr/bin/perl -p -e "s/~DRIVER~/Pg/g; s/^do\(/dontdo\(/" /usr/local/lib64/perl5/auto/DBI/Driver.xst > Pg.xsi /usr/bin/perl /usr/share/perl5/vendor_perl/ExtUtils/xsubpp -typemap /usr/share/perl5/ExtUtils/typemap Pg.xs > Pg.xsc && mv Pg.xsc Pg.c gcc -c -I/usr/include -I/usr/local/lib64/perl5/auto/DBI -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPGLIBVERSION=90223 -DPGDEFPORT=5432 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc -DVERSION=\"undef\" -DXS_VERSION=\"undef\" -fPIC "-I/usr/lib64/perl5/CORE" Pg.c In file included from Pg.xs:14:0: Pg.h:36:22: fatal error: libpq-fe.h: No such file or directory #include "libpq-fe.h" ^ compilation terminated. make: *** [Pg.o] Error 1 TURNSTEP/DBD-Pg-3.7.4.tar.gz /usr/bin/make -- NOT OK Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible Failed during this command: TURNSTEP/DBD-Pg-3.7.4.tar.gz : make NO
Jetzt lautet der Fehler „fatal error:libpq-fe.h:No such file or directory “. Das bedeutet, dass ich ein Paket oder eine Bibliothek installieren musste, die libpq-fe.h
enthält Datei. Nach dem Googeln verstehe ich ‚libpg-dev
‘ ist die Bibliothek, aber das ist für Ubuntu- und Debian-Rechner. Das entsprechende Paket für CentOS ist also ‚postgresql-devel
‘.
Installieren Sie postgresql-devel mit YUM
# yum install postgresql-devel ::::::::::::::::: Installed: postgresql-devel.x86_64 0:9.2.23-3.el7_4 Complete!
In Ordnung. Hoffentlich cpan
sollte nun DBD::Pg
installieren ohne Probleme. Schauen wir es uns an.
Neue Installation von DBD::Pg mit cpan
cpan[3]> install DBD::Pg Running install for module 'DBD::Pg' Running make for T/TU/TURNSTEP/DBD-Pg-3.7.4.tar.gz Has already been unwrapped into directory /root/.cpan/build/DBD-Pg-3.7.4-JtTHAe Could not make: Unknown error Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible
Was! cpan sagt, dass die Installation unmöglich erscheint? Nein, lass es uns manuell installieren. Dazu musste ich zu .cpan
gehen Verzeichnis, das sich unter dem Home des Benutzers befindet, und suchen Sie DBD-PG, das von cpan heruntergeladen wurde.
# cd /root/.cpan/build/DBD-Pg-3.7.4-ScxNAT
Lassen Sie uns Makefile
erstellen jetzt.
# perl Makefile.PL Configuring DBD::Pg 3.7.4 PostgreSQL version: 90223 (default port: 5432) POSTGRES_HOME: (not set) POSTGRES_INCLUDE: /usr/include POSTGRES_LIB: /usr/lib64 OS: linux Checking if your kit is complete... Looks good Using DBI 1.64 (for perl 5.016003 on x86_64-linux-thread-multi) installed in /usr/local/lib64/perl5/auto/DBI/ Writing Makefile for DBD::Pg
Cool. Was ist mit machen?
#make chmod 755 blib/arch/auto/DBD/Pg/Pg.so cp Pg.bs blib/arch/auto/DBD/Pg/Pg.bs chmod 644 blib/arch/auto/DBD/Pg/Pg.bs Manifying blib/man3/Bundle::DBD::Pg.3pm Manifying blib/man3/DBD::Pg.3pm
Wieder cool, was ist mit der Installation?
# make install Files found in blib/arch: installing files in blib/lib into architecture dependent library tree Installing /usr/local/lib64/perl5/auto/DBD/Pg/Pg.so Installing /usr/local/lib64/perl5/auto/DBD/Pg/Pg.bs Installing /usr/local/lib64/perl5/DBD/Pg.pm Installing /usr/local/lib64/perl5/Bundle/DBD/Pg.pm Installing /usr/local/share/man/man3/Bundle::DBD::Pg.3pm Installing /usr/local/share/man/man3/DBD::Pg.3pm Appending installation info to /usr/lib64/perl5/perllocal.pod
Ja. Ich habe jetzt erfolgreich „DBD::Pg
installiert ” Modul. Jetzt habe ich den OpenCA-Daemon gestartet und es hat ohne Probleme funktioniert.
Hoffe, es hilft jemandem da draußen.