AIX下用非root用户安装perl模组IO
Change password with a C/perl program using Pseudo Terminals;伪终端c/perl程序自动修改 Linux 用户密码;
但是在用non-root非root用户安装模组的时候,出现了一些问题,如下:
#perlMakefile.PL
Now let's see what we can find out about your system
(logfiles of failing tests are available in the conf/ dir)...
ERROR: cannot run the configured compiler 'cc_r'
(see conf/compilerok.log). Suggestions:
1) The complier 'cc_r' is not in your PATH. Add it
to the PATH and try again. OR
2) The compiler isn't installed on your system. Install it. OR
3) You only have a different compiler installed (e.g. 'gcc').
Either fix the compiler config in the perl Config.pm
or install a perl that was built with the right compiler
(you could build perl yourself with the available compiler).
Note: this is a system-administration issue, please ask your local
admin for help. Thank you.
安装前面的3个建议分别尝试,
1. 第一个建议,把编译器“cc_r"的path加到PATH里面,但是我的AIX上面没有安装这个编译器;
2.第二个建议,安装那个编译器,我是非root,没有办法安装一个编译器,没权限;
3. 我有gcc安装了,但是我没有权限去修改编译器的Config.pm文件,那么另外的一个方式就是,用系统上面的gcc编译安装一个perl. 从网上下载一个perl的source code,然后再自己的目录下面去安装perl,然后再安装perl的Pty.pm模组. 安装的过程可以根据下面的步骤进行:
Installing Perl modules on AIX 5.3
Installing Perl modules on AIX 5.3
Recently, a request was made to have the Perl module DBI/DBD installed on dopey, which at the time of this writing is running AIX 5.3. Unfortunately, since AIX does not ship with a native C compiler (without paying for it, of course), and the version of Perl that ships with AIX was built using cc_r, you can't install Perl modules that require the original compiler that Perl was built with. To get around this, you can build a new version of Perl using the GNU compiler (gcc, /opt/freeware/bin/gcc) so that additional Perl modules can be installed.
Installing Perl using gcc 4.2.0 from the freeware archive:
1. Download source tarball from http://www.perl.org/get.html (perl-5.10.0.tar.gz)
2. Upload the source to the destination host and untar it.
3. Decide where to install this particular build, and run the usual configure/make/make install, specifying gcc as the compiler:
# ./Configure -des -Dcc=gcc -Dprefix=/opt/perl
# make
# make install
4. Verify the installation is complete:
# /opt/perl/bin/perl -v
This is perl, v5.10.0 built for aix
Copyright 1987-2007, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
5. Install the necessary modules, such as DBI, using the typical installation steps (ensure PATH to new Perl build is accurate):
tar xvf DBI-1.608.tar
cd DBI-1.608
perl Makefile.PL
make
make install
You can then verify that the .pm's are present in /opt/perl/lib/5.10.0.
Notes on DBD::Oracle:
Before installing DBD::Oracle, you will need to set your ORACLE_HOME and LIBPATH:
ORACLE_HOME=/oracle/pscs/app/oracle/product/10.2.0 (may vary)
LIBPATH=/oracle/pscs/app/oracle/product/10.2.0/lib32
After you run "perl Makefile.PL", you will need to manually modify the Makefile and change references from "lib" to "lib32" in the Oracle PATH. This is a known flaw.
See notes below for additional information on DBD:Oracle
64 bit Install Notes
As of Oracle 11.2, 32 bit libraries are no longer delivered. This requires the installation of 64 bit versions of Perl 5, DBI, and DBD::Oracle (all 64 bit). The first system where this was requested was dbcsdev1.
The following versions of the software was installed:
Perl 5.12.2
DBI 1.615
DBD:Oracle 1.26
The procedure outlined in the above notes is still valid as the general workflow for doing the installation. The notes below add to or replace information, relevant to a 64 bit install:
Step 3 addendum:
Here's the configure command line to use if you are compiling a 64 bit version of Perl under AIX:
./Configure -des -Dcc=gcc -Duseshrplib -Duse64bitall -Dprefix=/opt/perl5_64
Step 4 addendum:
bash-3.00# /opt/perl5_64/bin/perl -v
This is perl 5, version 12, subversion 2 (v5.12.2) built for aix-64all
...
Step 5 addendum:
You'll need to modify the path so that the version of Perl just installed takes precedence (this is just a clarification of the information above):
export PATH=/opt/perl5_64/binPATH
The steps for installing DBI are the same as outlined above.
DBD:Oracle
DBD:Oracle is a bit trickier. The notes above are not relevant for the 64-bit install, however, this section will talk about DBD:Oracle a bit more in general.
The following environment variables need to be set in order to compile DBD:Oracle on a 64 bit platform:
export ORACLE_HOME=/oracle/pscs/app/oracle/product/11.2.0
export LIBPATH=/oracle/pscs/app/oracle/product/11.2.0/lib
export LD_LIBRARY_PATH=/oracle/pscs/app/oracle/product/11.2.0/lib
You'll need to modify the Oracle version in the path, as necessary.
Note that in contrast to above, the /lib directory is specified, as opposed to the lib32 directory. (The /lib directory contains the 64 bit material).
perl Makefile.PL -V 11.2
make
make test will attempt to connect and log into the Oracle instance, and run a battery of tests such as creating tables, and so on an so forth.
Chris set up a test account on the PTDEV instance with connect only privileges. We can't run all the tests DBD:Oracle wants to, but this way we can make sure it can connect and log into the Oracle instance.
The following environment variables should be set to run make test. The test will fail out at the Create Table step, but that's to be expected.
export ORACLE_DSN=dbi:OracleTDEV
export ORACLE_SID=PTDEV
export ORACLE_USERID=jriddle1/[putthepasswordhere]
make test
...
t/12impdata.t ............. DBD::Oracle::db do failed: ORA-01031: insufficient privileges (DBD ERROR: OCIStmtExecute) [for Statement "create table dbd_ora__drop_me ( idx integer, nch nvarchar2(20), descr varchar2(50), dt date )"] at t/nchar_test_lib.pl line 384.
Finally, make install.
Quick and dirty test:
Here's a simple perl script to test a connection. make test does the same thing, but this you can use after the fact or for troubleshooting/diagnostic purposes.
#!/opt/perl5_64/bin/perl
use DBI;
$dbh=DBI->connect("dbi:OracleTDEV","jriddle1","[putyourpasswordhere") or die "roblem connecting to Oracle";
$DBI::errstr;
#$stmt=$dbh->prepare("create table tester (testthis varchar2(1))");
#$rc=$stmt->execute() || die $DBI::errstr;
$dbh->disconnect or warn "Disconnection error: $DBI::errstr\n";
Should return no output. For kicks, you can uncomment the two lines and watch it fail out on the create table SQL code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
第二个安装建议挺不错的,我这样可以。
在用non-root非root用户安装模组的时候,出现了一些问题,这种情况不是很常见的