How to search for a library file on solaris? - solaris

I want to use openssl library files in a program. Openssl is installed on the server but I don't know by what name. How do I search for it on the server using telnet and include those files in my program to run it successfully?

OpenSSL consists of several library files. You may need -lssl or -lcrypto or others. Ask your system administrator where it is installed, if it's not in the default locations.

Related

how to generate a copy of this binary perl distribution

I'm working with an application that downloads its own copy of Perl from a 3rd party website as a sort of bootstrap. I'd like to get a different copy from a more trusted source like CPAN, but I can't find any precompiled copies of Perl (only full source distributions) and I don't know how to build from source. Is there anywhere I can get a precompiled copy?
Another problem is that I don't know for sure that this download is just "a compiled copy of Perl". I'm assuming that, but I don't know what it's supposed to look like.
It comes in a .tar.gz which really only has two directories populated:
/bin (contains perl, cpan, perldoc, enc2xs, etc)
/lib/5.16.3 (contains subdirectories for various CPAN modules)
So to summarize: 1) Is this what Perl looks like when it is compiled? 2) Where can I get a pre-compiled version of Perl for my OS (RHEL 7), or if this isn't possible, how can I best generate a compiled version?
PS: For those who are curious, this is the copy of Perl that is downloaded by Miyagawa's Heroku Perl buildpack (https://github.com/miyagawa/heroku-buildpack-perl), which I am using for a project. He downloads copies of Perl stored on a website cache.bulknews.net, which might just be his own hosting, not sure.
I don't know how to build from source
This is documented in INSTALL in the distribution.
It's quite simple on a unix system:
cd /tmp
wget https://cpan.metacpan.org/authors/id/S/SH/SHAY/perl-5.26.1.tar.bz2
tar xvjf perl-5.26.1.tar.bz2
cd perl-5.26.1
sh Configure -des -Dusethreads -Dprefix='/some/dir'
make
make test
make install
You might also want to pass -Duserelocatableinc to make the install relocatable.
You can also use perlbrew or plenv to assist you with installing perl and managing multiple installs of perl.

Installing cpan or cpanm modules on a behind-firewall machine with no Internet connection

I've already read related threads like these, but they do not fully capture our situation.
This is on a firewalled machine. No net access. We can ftp files to folders and install modules from there.
We have CHMOD 777 for our users on some folders. We can install Perl modules if we locally build them by downloading the relevant .pm files. But when these files cannot install, we do not have any cpan or cpanm.
I'd like to install, for example, HTML::Restrict. If I do the download + install thing, the Restrict.pm gives me this error:
/lib/HTML/Restrict.PM:328: Unknown command paragraph "=encoding UTF-8"
Reading a bit online suggests that this could be an old Perl problem. We use 5.8.x. Our own dev machines have the luxury of 5.16.x and internet access so installing module is a cinch. Anyway, one of my older machines also has 5.8.x, and installing the module via cpanminus worked there (with internet).
So, question: is it possible to install "cpanminus" (cpanm) through FTP, then upload specific module files to the server through FTP too, and then go into shell and install modules via cpanm by pointing it to respective .pm files?
Thank you for any pointers.
You should take a look at perldoc perlmodinstall which goes into detail about how to install a module from its distribution. It follows what should be a familiar incantation
Decompress
Unpack
Build
Test
Install
Assuming you're on a Linux system, this commonly takes take the form of
gzip -d My-Module-Distribution.tar.gz
tar -xof My-Module-Distribution.tar
perl Makefile.PL
make
make test
make install
But after the Unpack stage you will often find a README file or other text file that will describe any unusual steps to be taken
Clearly some of these steps can be combined. For instance, most people will probably want to use
tar -xvfz My-Module-Distribution.tar.gz
to avoid having to invoke gzip separately. Likewise, the make system will force a build phase as a prerequisite if you use just
make test
without the preceding make
The linked document has a lot to say about how to install on other platforms, should you not be running a Linux variant
I still don't really understand your thinking, but you can get a stand-alone version of cpanm using curl. For instance
curl -sS --location https://cpanmin.us/ --output cpanm
then you should be able to just copy it to your target machine, put it on your PATH, and do
cpanm HTML-Restrict-2.2.2.tar.gz
but I doubt if you will find any change to the specific errors you are getting

Building postgres with specific openssl

How can I build Postgres from source while specifying a specific version of openssl to use during the build? I don't want to use a distro-specific installation of openssl, so anything like apt-get install libssl-dev is out.
It looks like the configure script included with the Postgres source (v9.3.5) has two options, --with-includes and --with-libraries, that look like they should allow me to add additional search locations for libraries when configuring, but I've been unable to get the configure script to find a specific version of openssl.
I'm relatively new to building from source using nonstandard or local libraries, so any additional input is appreciated.

Mountain Lion Zend Install - You must enable the openssl extension to download files via https

I've been trying to get Zend installed on my Mac Pro for some time. I've tried installing it manually, with homebrew, and with port. I've changed php's, reinstalled php, updated php, reinstalled openssl multiple times.
php.ini has openssl in it and it is uncommented, curl is also enabled.
no matter which way I go about it I always get a message like this or very similar (always ssl)
You must enable the openssl extension to download files via https
I also installed a certificate for ssl.
currently I have downloaded the zip for the Zend 2.2.2 'tutorial', extracted to a sites directory and have run
composer install
which as given me:
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing zendframework/zendframework (2.2.2)
[RuntimeException]
You must enable the openssl extension to download files via https
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader]
I know its installed. I've reinstalled it 3 times. Only thing I can think of is maybe there is more than one php.ini but I haven't been able to find a second one.
thanks in advance for any advice.
I ran php info in apache and got the old install of php version 5.3, when I run it from the command line I get the new 5.4 ?
$ openssl version
OpenSSL 1.0.1e 11 Feb 2013
$ composer diag
Checking platform settings: FAIL
The openssl extension is missing, which will reduce the security and stability of Composer.
If possible you should enable it or recompile php with --with-openssl
Checking http connectivity: OK
Checking composer.json: OK
Checking disk free space: OK
Checking composer version: OK
There is more than one php.ini - the command line version of PHP has a separate one. To see what that is, run php -i | grep ini from the command line - the output should include the .ini files being used near the top.
(Disclaimer: I'm not a Mac user so things may be different in Apple world.)
I'd like to say there was an easy fix. My suggestion is to use homebrew, install everything, then make sure your php.ini is in the right spot (probably have to move it) and also that you change the permissions on local\openssl so that homebrew can write to it. Eventually by moving php.ini around and installing php54 I was able to get it to work.
these are great resources
http://juniorgrossi.com/2013/working-with-multiple-php-versions-on-mac-os-x/
http://railsapps.github.io/openssl-certificate-verify-failed.html

Where do I get libpq source?

I want to write application which uses Postgresql as DBMS.
To write client application do I need libpq library and header files?
If yes where I would get libpq library and header files.
Libpq is included in the full PostgreSQL source code. You can use just libpq without the rest of PostgreSQL, but must download the full package.
You can download it from the PostgreSQL Downloads page.
Once you extract the full package it is inside src\interfaces\libpq.
The PostgreSQL installation guide details how to install only the client libraries in the Installation section, under Client-only installation.
Libpq documentation is also available.
In postgresql sources, src\interfaces\libpq.
And yes, it is possible to compile only the libpq.
get the lipq from repo, {for debian} :
sudo apt-get install libpq-dev
I was also facing this issue but didn't got a clear answer:
This issue clearly states that while installing diesel-cli system is not able to locate libpq.lib
First of all you should have a Postgres installed on your machine.
Also diesel require visual c++, thus download and install it if not already, the size of setup will be ~5gb.
Once above installations are done you need to setup environment variables:
In my case path of Postgres installation is C:\Program Files\PostgreSQL thus add 2 environment variable path under User variables add new in Path where your libpq.lib is located in my case it is available in both C:\Program Files\PostgreSQL\12\lib and C:\Program Files\PostgreSQL\12\bin
Once this is added create one more environment variable PQ_LIB_DIR and set path as shown below
Note: Once done re-trigger the installation command in a new cmd window
Source: pq-sys and github-solution
For Windows users, it's in (version may be different)
C:\Program Files\PostgreSQL\11\lib
There you find libpq.lib. Provide this directory to Linker input.
Don't forget to include C:\Program Files\PostgreSQL\11\include directory for include directories.
I fix this problem reccently. This is a solution if you don't want to install Postgres in you windows.
At first, you need download Postgres Binaries. The version I download is 13.6, but it's seems like any version is fine.
Unzip the zip file.Copy libpq.lib from pgsql\lib to shomewhere like C:\Program Files\Postgres\lib.
Execute the following command in cmd window.
setx PQ_LIB_DIR "{where_you_copy_to}"
Open a new cmd windows and install diesel_cli
cargo install diesel_cli --no-default-features --features postgres
In linux vertify you get the libpq.
1st, there is an app: pg_config: https://www.postgresql.org/docs/current/app-pgconfig.html
after you found out the pg_config absolute bin path.(if you installed multi version of postgressql) Then You can get
--includedir
Print the location of C header files of the client interfaces.
--libdir
Print the location of object code libraries.
Then try to compile/build some example code: https://www.postgresql.org/docs/current/libpq-example.html
Some common failure example: https://www.postgresql.org/docs/current/libpq-build.html
You can install Postgres locally from https://www.enterprisedb.com/downloads/postgres-postgresql-downloads but select only "Command line tools" for install.
After that, you can found libpq.dll in C:\Program Files\PostgreSQL\15\bin