Installation fails: informix sdk 4.50.FC7, pdo_informix 1.3.6, PHP8 - pdo

I'm trying to install PDO_INFORMIX 1.3.6 with Informix-SDK 4.50.FC7 on PHP 8
and I'm running in issues even though I stick to the documentation.

Finally made it work with these settings. Might be not the optimum, but it worked for me.
# download informix sdk, go to content
./installclientsdk -i console
# ^^^^^^^^^ documentation states installclientsdk -console
# install with default settings
# for PDO: Specify Client Dir as env var
export INFORMIXDIR=/opt/IBM/Informix_Client-SDK
# add path which actually contains the files
LD_LIBRARY_PATH=$INFORMIXDIR/incl/cli:$INFORMIXDIR/lib/cli:$INFORMIXDIR/lib/esql:$LD_LIBRARY_PATH
# ^^^^^^^^^^^^^^^^^^^ cli is here, the documentation doesnt specify this
export LD_LIBRARY_PATH
# pecl / pdo
cd /install/PDO_INFORMIX-1.3.6
phpize
./configure --with-pdo-informix=/opt/IBM/Informix_Client-SDK
make
make install
# add `extension=pdo_informix.so` to the php.ini

Related

How to install Apache on OmniOS

I am attempting to install Apache on OmniOS. I followed the instructions here: option 2 https://wiki.openindiana.org/oi/3.+Installing+software+and+package+management
Ran the command:
echo $PATH results in /opt/local/sbin:/opt/local/bin:/usr/gnu/bin:/usr/sbin:/sbin
curl https://pkgsrc.joyent.com/packages/SmartOS/bootstrap/bootstrap-2016Q4-x86_64.tar.gz | gtar -zxpf - -C /
pkgin -y update
pkgin -y install apache-2.4.6 resulted in the messages Calculating dependencies...done and then nothing to do
I can not find the apache service or configuration directory as they are described here: https://docs.joyent.com/public-cloud/instances/infrastructure/images/smartos/apache
/opt/local/etc/httpd The configuration directory for Apache
svcs pkgsrc/apache Checking service for Apache
Server Info:
uname -v results in omnios-r151026-d9b45886bd
Running x86
Also running SunONE webserver
Though incomplete, my commands did make a change. My Perl scripts can no longer find DBI.
Why does the Apache install say there is nothing to do? What am I missing?
UPDATE
Ran which apache2 resulted in no apache2
Ran pkgin list to list all installed packages. Only apache
reference is apache-maven-3.5.4
Ran find . -name '*apache*' in the following directories:
\etc nothing
\opt found:
vim, el, and elc files in SUNWspro
org-apache-tools-ant-module files and folder in netbeans/3.5V11/modules/patches
apache folder in SUNWwbsvr/plugins/java/samples/webapps/jstl/src/org which contains java files
vim, tag, el and elc files in sfw --- also an apache folder in sfw which contains readme/bash type files for apache/php and one so file
apache-maven-3.5.4 files/folders in local
org-apache-xml-resolver* files in sunstudio12.1
'\usr' found:
2 vims in share/vim/vim80/syntax
apache-fcgi.conf in lib/python2.7/vendor-packages/cherrypy/scaffold
'\var' nothing
As far as I can tell, the binaries have not been installed
I tried running pkgin -y install apache-2 and it worked. It installed apache-2.4.3. Perhaps apache-2.4.6 does not exist in the repository.
This mean apache is already installed on the Linux system. To run below command which will tell the location of the system binary.
which apache2
for the configuration folder look for below directory:
/etc/apache2

Upgrading openssl from 0.9.8 to 1.0.2 / Ubuntu 8.04 LTS

first of all, thanks for your time trying to help.
I have an old server, Ubuntu 8.04, not supported anymore.
Since June, a payment platform I'm working with has deactivated the TLSv1 and SSL.
My server is running under :
Apache 2.2.8 /
Openssl 0.9.8 /
PHP 5.2.17 /
Ubuntu 8.04
I have installed a new version of openssl (using wget) :
openssl version
OpenSSL 1.0.2o 27 Mar 2018
My version of apache is too old to support TLSv1.2, I need to upgrade it to apache 2.2.23 minimum version.
How to compile apache in order to take into account the new OpenSSL version?
PS: I just take a new server to migrate my website, but it takes time to adapt the code... Changing the server is not an option for now .. I need to make it work as fast as possible, and then I'll be able to focus on the error introduced by PHP 7...
Thanks in advance to help the newbie i am..
Since this old Ubuntu is no longer supported, you can most probably not use the repos to install Apache.
Compiling your own is doable following instructions here: http://httpd.apache.org/docs/2.2/install.html.
When you run ./configure you will have to use --enable-ssl and --with-ssl=DIR. The DIR is where OpenSSL resides (not the source code, but the installation directory). Check the ./configure output to identify any missing requisites.
Once you run make install, you will then have to compile PHP with that new OpenSSL, and link to the newly compiled Apache. http://ca3.php.net/manual/en/install.unix.apache2.php
This is how I compile my HTTP (notes taken a while back, some versions might differ). Adapt for your needs, and this is provided "as is", no warranty :-)
The prerequisites are based on RHEL 6 or 7, adapt as required.
Required software:
- apr-1.6.2
- apr-iconv-1.2.1
- apr-util-1.5.4
- httpd-2.4.26
(identical procedure used with previous versions of 2.4)
- openssl-1.0.2l
(identical prodecure used with older versions of 1.0)
- Unzip and untar these under /opt/app/SOURCES
System setup
Ask Unix to create:
- /opt/app/httpd, owner httpd, group httpd, permissions 775
- user httpd, group httpd
Create these directories
- /opt/app/apr
- /opt/app/apr-iconv
- /opt/app/apr-util
- /opt/app/httpd
- /opt/app/openssl
- all owned by httpd, group httpd, permissions 750
Procedure
Get Unix to install prerequisites
for F in libxml2.i686 libxml2.x86_64 libxml2-devel.i686 libxml2-devel.x86_64 apr-devel.i686 apr-devel.x86_64 apr-util.i686 apr-util.x86_64 pcre-devel.i686 pcre-devel.x86_64 autoconf libtool
do
yum install -y $F
done
Switch to the httpd user.
Install APR
cd /opt/app/SOURCES/apr-1.6.2
./buildconf
./configure --prefix=/opt/app/apr
make
make install
Keep the directory as is, APR Util and APR Iconv require the APR sources to refer to.
Install APR Util
cd /opt/app/SOURCES/apr-util-1.5.4
./buildconf --with-apr=/opt/app/SOURCES/apr-1.6.2
./configure --prefix=/opt/app/apr-util --with-apr=/opt/app/apr
make
make install
Install APR Iconv
cd /opt/app/SOURCES/apr-iconv-1.2.1
./configure --prefix=/opt/app/apr-iconv --with-apr=/opt/app/apr
make
make install
Install OpenSSL
cd /opt/app/SOURCES/openssl-1.0.2l
export CFLAGS=-fPIC
./config --prefix=/opt/app/openssl --openssldir=/opt/app/openssl shared
make clean
make
make test
make install
Install Apache
cd /opt/app/SOURCES/httpd-2.4.26
export LD_LIBRARY_PATH=/opt/app/openssl/lib
./configure --prefix=/opt/app/httpd --with-mpm=worker --enable-rewrite --enable-ssl --with-ssl=/opt/app/openssl --enable-proxy --enable-rewrite --enable-log-forensic --enable-log-debug --enable-expires --enable-headers --enable-unique-id --with-apr=/opt/app/apr --with-apr-util=/opt/app/apr-util
make
make install
vi /opt/app/httpd/bin/envvars
Add /opt/app/openssl/lib to the LD_LIBRARY_PATH
Note for the ./configure: this was done to build an Apache used as a proxy. change the --enable* options as required.
Configure HTTP
- The original configuration files after installation are saved in /opt/app/httpd/conf/original
- While it is impossible to cover all configuration options, at least these should be changed from the install configuration:
--- Listen 80: change as required.
--- User httpd
--- Group httpd
--- ServerAdmin EMAILADDRESS
--- ServerName <HOSTNAME>:80
--- Comment or uncomment the modules, as required
--- Uncomment slotmem_shm_module
--- Comment: CustomLog "logs/access_log" common
--- Uncomment: CustomLog "logs/access_log" combined
--- Comment the following sections (the entire section!):
----- <IfModule alias_module>
----- <IfModule cgid_module>
----- <Directory "/opt/app/httpd/cgi-bin">
--- Uncomment:
----- Include conf/extra/httpd-mpm.conf
----- Include conf/extra/httpd-default.conf
----- Edit conf/extra/httpd-mpm.conf
----- Change performance options as required. The defaults are ok until you have a large amount of traffic.
----- Edit conf/extra/httpd-default.conf
----- Comment AccessFileName .htaccess
----- ServerTokens Prod
--- Test the configuration: /opt/app/httpd/bin/apachectl -t
--- Start it and access it with a browser. It should return a simple "It works!" message (unless you have installed some HTML content).
And this is my procedure for PHP compilation, again no warranty, "as is". You can ignore the parts about DB2, Oracle and PostgreSQL if you do not connect to these DB.
Prerequisites
- A compiled version of Apache HTTP and it's requisites. See HTTP installation.
- It "could" work with RedHat's compiled Apache, but it is not recommended. If RH's Apache is used, might as well use RH's PHP build.
- PHP source code: download from http://php.net
- This procedure has been tested with success on versions: 5.3.13, 5.5.7, 5.6.3, 5.6.30. No modifications were required.
Install Red Hat pre-requisites:
- libxml, libxml-devel
- libpng, libpng-devel
- libjpg, libjpg-devel
If using DB2
- Install DB2 client under /opt/app
- PHP searches for the lib directory, so:
cd /opt/app/ibm/db2/V10.5
ln -s lib64 lib
If using Oracle
- Install the Oracle Instant Client in /opt/app/oracle
Overview
PHP must be compiled and "linked" to Apache. Apache must therefore be compiled before PHP.
Depending on which database PHP will connect to, the configure options must be changed.
http://php.net has more documentation and details for the build process, this is just what was used.
Build
Pre-compile configure
The configure command will detect what other software is installed on the system and link libraries.
Note for the database clients: they can all be linked at the same time, but it is recommended to link only the ones required.
The command is:
./configure --with-apxs2=/opt/app/httpd/bin/apxs \
--prefix=/opt/app/php \
--with-config-file-path=/opt/app/php \
--enable-zip \
--with-zlib \
--enable-mbstring \
--with-gd \
--with-pear \
--with-pdo-odbc=ibm-db2,/opt/app/ibm/db2/V10.5 \ # if using DB2 only!
--with-oci8=instantclient,/opt/app/oracle/instantclient_11_2 # if using Oracle only!
--with-pgsql \ # if using PostgreSQL only!
--with-pdo-pgsql # if using PostgreSQL with PDO only!
Compile
make clean
make
make test
make install
$(make test) will report errors for the Oracle driver. MANY errors! The driver will still work (it was used for the nettracker replacement scripts to load Pharmaclik IBM HTTP Server logs into Oracle). But it will be impossible to use bind variables on Integers. That explains why that script does not use oci_bind* functions.
Post-compile configure
libtool --finish /opt/app/php/lib
cp php.ini-development /opt/app/php/php.ini
OR
cp php.ini-production /opt/app/php/php.ini
In php.ini, add these:
include_path = ".:/php/includes:/opt/app/php/lib/php"
date.timezone = 'America/Montreal'
Configure Apache
These lines are possibly already there since the PHP $(make install) takes care of it, if the httpd.conf file is "clean" (i.e. has not been modified from the originally installed file).
Add these to httpd.conf:
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php .phtml

How to install PHP extensions on Cloudbees?

I need to install mbstring (and a few other extensions) for PHP on Cloudbees. Is this possible?
Note that I'm using an updated PHP version as described here:
https://developer.cloudbees.com/bin/view/DEV/PHP+Builds
I don't think scripts have sudo access, so I can't simply use the package manager. I don't think these extensions exist as PEAR packages either. So I'm stumped.
Here is the response from Cloudbees support. Seems to work fine, just make sure you don't have any spaces in your Jenkins build path!
Our provided PHP versions don't have mbstring module activated. You will need to build your own PHP version to get it. To be sure your custom PHP build works on Cloudbees slave, you can build it with a Jenkins job on your instance (with various --with-XXX or --without-XXX options).
We are ourselves doing something like this with a script like
# Download
regex='.*(RC|alpha|beta).*'
if [[ $version =~ $regex ]]; then
wget http://downloads.php.net/dsp/php-${version}.tar.bz2
else
wget http://us3.php.net/distributions/php-${version}.tar.bz2
fi
# Unpack
tar xjf php-${version}.tar.bz2
# Build
cd php-${version}
./configure --prefix=/home/jenkins/tools/php/${php_name} \
--with-curl --with-openssl
make && make install
As a side node, you should also take care of specifying a good installation prefix with --prefix. I would choose something like /home/jenkins/tools/php/5.4/.
To store compiled php engine you could generate a tar.gz//bz2 file of target installation directory. Then, store it in your WebDAV directory, which is accessible in /private/{account}/ during a build when "Mount CloudBees DEV#cloud Private WebDav Repository" is checked.
You should add a first step to jobs requiring PHP to extract this archive. As Jenkins workspace is usually cached on DEV#Cloud, you can extract the archive only if it's not already there. That will speed up your build.

install memcache onfedora linux OS

I installed memcache in the following way:
1) yum install memcached
2) yum install php-pecl-memcached
3) Also enabled the 'memcached.so' in php.ini
I tested the memcached in the follwing way:
$mc = new Memcache;
$mc->addServer('localhost', 11211);
echo "Server's version: " . $mc->getVersion() ;
But it generates the following error:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/memcached.so' - /usr/lib64/php/modules/memcached.so: undefined symbol: php_json_encode in Unknown on line 0
PHP Fatal error: Class 'Memcache' not found in /root/memcacheTest.php on line 2
Thank u.
I don't know PHP well (or at all), but from the error message I'll hazzard a guess that you do not have the PHP JSON extension installed, which is apparently needed by the memchached extension.
Apparently, the JSON extension has been in PHP since version 5.2.0, therefore:
You have an older version and you need to upgrade or install the JSON extension yourself
or
Your operating system distributor supplies the PHP JSON extension in a different package that you have not installed.
There is of course the possibility of a misconfiguration, but I think it's slightly less likely.
This showed memcached.so didn't loaded successfully.
Error shows the reason: json.so should be load before memcached.so
Please use php -m | grep memcached to check whether memcached.so is loaded successfully.
If show memcached, this mean it succeeded.
If show like PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/memcached.so' - /usr/lib64/php/modules/memcached.so: undefined symbol: php_json_decode_ex in Unknown on line 0
Here is the solusion:
e.g your php.ini is /etc/php.ini, your php.d is /etc/php.d/
Solution 1
comment 'memcached.so' in php.ini
vim /etc/php.d/memcached.ini
add extension=memcached.so in /memcached.ini
php -m | grep memcached check whether memcached is succeed loaded
Solution 2
rm /etc/php.d/json.ini
add extension=json.so in php.in before extension=memcached.so
php -m | grep memcached check whether memcached is succeed loaded
Can you check and double check user permissions? Additionally, my experience with PHP is that the distribution repository versions of PHP aren't very good. I solved those symbol errors by compiling PHP from the ground up. But that's a very radical and time-consuming solution.
http://pecl.php.net/bugs/bug.php?id=17574&edit=1
Just make sure that extension=json.so is specified BEFORE
extension=memcached.so.
I had placed extension=memcached.so in php.ini, and extension=json.so
was specified in /etc/php.d/json.ini, that is parsed AFTER php.ini.
That is why PHP can't find php_json_encode() at the point of loading
memcached.so.
Also, check that the permissions on memcached.so are the same as the other extensions
Try to install the version 2.0. It helped for me.
yum -y install gcc-c++
wget http://launchpad.net/libmemcached/1.0/0.50/+download/libmemcached-0.50.tar.gz
tar xzf libmemcached-0.50.tar.gz
cd libmemcached-0.50
./configure
make
make install
wget http://pecl.php.net/get/memcached-2.0.0b2.tgz
pecl install memcached-2.0.0b2.tgz
echo 'extension=memcached.so' > /etc/php.d/memcached.ini
service php-fpm restart
cd ..
rm -r libmemcached-0.50*
rm -r memcached-

Autoconf macros for Apache and conf.d install process?

I have a package that is using the autotools to build and install.
Part of the package is a website that can be run on the local machine.
So in the package there is a .conf file that is meant to be either
copied or linked to the /etc/apache2/conf.d directory. What's the
standard way that packages would do this? If possible, I'd like for
the user not to have an extra step to make the website work. I'd like
to have them install the package and then be able to browse to
http://localhost/newpackage to get up and running.
Also, is there a way that autoconf knows about the apache install or a
standard way through then environment some how? If someone could
point me in the right direction that would be great.
Steve
The first thing you should do is to locate the apache extension tool apxs or apxs2 (depends on apache version and/or platform you are building for). After you know where your tool is located you can run queries to get certain apache config params. For example to get system config dir you can run:
apxs2 -q SYSCONFDIR
Here is a snippet of how you can locate apache extension tool: (be careful it may contain syntax errors)
dnl Note: AC_DEFUN goes here plus other stuff
AC_MSG_CHECKING(for apache APXS)
AC_ARG_WITH(apxs,
[AS_HELP_STRING([[--with-apxs[=FILE]]],
[path to the apxs, defaults to "apxs".])],
[
if test "$withval" = "yes"; then
APXS=apxs
else
APXS="$withval"
fi
])
if test -z "$APXS"; then
for i in /usr/sbin /usr/local/apache/bin /usr/bin ; do
if test -f "$i/apxs2"; then
APXS="$i/apxs2"
break
fi
if test -f "$i/apxs"; then
APXS="$i/apxs"
break
fi
done
fi
AC_SUBST(APXS)
The way to use APXS in your automake Makefile.am would look something like this:
## Find apache sys config dir
APACHE2_SYSCONFDIR = `#APXS# -q SYSCONFDIR`
## Misc automake stuff goes here
install: install-am
cp my.conf $(DESTDIR)${APACHE2_SYSCONFDIR}/conf.d/my.conf
I assume you are familiar with automake and autoconf tools.