Installing oci8 extension in linux for php? - php

I don't have a oracle database installed in my system. But i want to connect to the remote system. Do i just need to install oci8 extension library or i need to install both instantclient and the oci8 extension?

If I remember correctly, OCI8 extension wouldn't even compile without Instant Client; if you install using PECL, it asks you for Instant Client path. Moreover, from my experience, you'll also need Instant Client SDK in addition to Basic, unpack them to one directory, and make some symlinks before running PECL command:
sudo ln -s libclntsh.so.* libclntsh.so
sudo ln -s libocci.so.* libocci.so
Don't forget to enable the config later:
echo "; configuration for php oci8 module" | sudo tee /etc/php5/conf.d/oci8.ini
echo extension=oci8.so | sudo tee -a /etc/php5/conf.d/oci8.ini
Taken from this post (in Russian), also installed OCI8 myself recently on Debian 7.

Related

php's ssh2 extension installation on RHEL8 with php 7.4

I have installed php7.4 via RHEL8's Default Stream using dnf.
I want to install the php's ssh2 module.
How do I install Pyrus (Pear2 Package Manager) on RHEL8 with php7.4?
When I tried: php pyrus.phar
I got the error message in command prompt: Could not open input file: pyrus.phar
I used:
updatedb
locate pyrus
Got nothing
So, what is the issue here?
Best Regards
Thayalan
I wanted to install php's ssh2 extension via Pyrus but I was having trouble with Pyrus. Therefore, I tried it without Pyrus. I preferred yum or dnf installation throughout. But, it was not possible for some. The following are how I have installed ssh2:
yum install make gcc php-devel php-pear
libssh2 package (ssh2 package needs it) installed by downloading the file https://libssh2.org/download/libssh2-1.10.0.tar.gz into an appropriate folder.
Then, I entered the following commands:
tar -zxvf libssh2-1.10.0.tar.gz
cd libssh2-1.10.0
./configure
make
make install
ssh2 package installed by downloading the file https://pecl.php.net/get/ssh2-1.3.1.tgz into an appropriate folder.
Then, I entered the following commands:
tar -zxvf ssh2-1.3.1.tgz
cd ssh2-1.3.1
phpize
./configure
make
make test
make install
Then I entered the following entry into /etc/php.ini: extension=ssh2.so
After that, I restarted php by: systemctl restart php-fpm
And now, php's ssh2 extension has been successfully installed.

Could not find driver ( PHP and Firebird )

I have a web-based PHP script named portail, so I want to make it functional on Ubuntu.
I installed Xampp 5.6 , Firebird 2.5 under Ubuntu, then I uncommented the library:
"extension=php_pdo_firebird.dll"
and I made the specific configuration for php5 and firebird
(https://mapopa.blogspot.com/2009/04/php5-and-firebird-pdo-on-ubuntu-hardy.html),
but he always shows me the following message
could not find driver localhost/portail
Screenshot:
You should install the required php extension if not already installed by default installation process. Php extensions are binaries which help php do extra things which can not without them. For example there is another well-known php extension called X-Debug which helps php developers debug their code.
First of all check that you have this php_pdo_firebird extension installed (or not), using Ubuntu CLI (Command-Line Interface):
installed system-wide by default:
php -m | grep -i pdo-firebird
installed using your package manager:
dpkg --get-selections | grep -i php-pdo-firebird
If none of the above returned a result, then you do not have that extension installed. you should install it using your preferred package manager:
sudo apt-get update -y
sudo apt-get install -y php-pdo-firebird
Try this
php -v
apt-get install -y php<your php version>-interbase

How to enable LDAP extension for PHP in Ubuntu

I am trying to enable LDAP for PHP5.6 on Ubuntu 16.04. I have tried the following steps
- sudo apt-get install php5-ldap
- sudo enmod ldap
- sudo php5enmod ldap
but still I am unable to get my ldap related functions working with PHP
you need to restart your apache (systemctl restart apache2). Apache has its very own single php-process running*. The php-configuration is only reload if apache restarts this process. You can check your active configuration with phpinfo
* this is very simplified and depends on the apache MPM-Module you are using.
sudo apt-get install php-ldap
/etc/init.d/apache2 restart
#baig772 answered their own question but they didn't post it as an answer.
latest ubunutu php-ldap was not working I tried installing apt-get install php7.0-ldap which is not working, then I download deb https://debian.pkgs.org/sid/debian-main-amd64/php7.2-ldap_7.2.4-1+b2_amd64.deb.html
wget http://ftp.br.debian.org/debian/pool/main/p/php-defaults/php-common_49_all.deb
wget http://ftp.us.debian.org/debian/pool/main/p/php7.0/php7.0-ldap_7.0.29-1+b2_amd64.deb
wget http://ftp.us.debian.org/debian/pool/main/u/ucf/ucf_3.0038_all.deb
then..
apt install ./php7.2-common_7.2.4-1+b2_amd64.deb
apt install ./php7.2-ldap_7.2.4-1+b2_amd64.deb
...
once it is installed confirmed by running the
apt-cache pkgnames | grep ldap | grep php
php-symfony-ldap
php7.2-ldap
php-net-ldap2
php-net-ldap3
check php enabled modules
:/usr/lib/php/7.2# php -m
ctype
curl
date
dom
fileinfo
filter
ftp
gd
hash
iconv
it does not have ldap module..
so copied .so files
:/usr/local/etc/php# cp /usr/lib/php/20170718/ldap.so /usr/local/lib/php/extensions/no-debug-non-zts-20170718/
enable apache ldap " a2enmod ldap"
php-m
now it has ldap module enabled.
[PHP Modules]
Core
ctype
curl
date
dom
fileinfo
filter
ftp
gd
hash
iconv
json
ldap
libxml
mbstring
restart apache and checked in info.php.
/etc/init.d/apache2 stop
/etc/init.d/apache2 start

installing imap on ubuntu for php7.1

How can one install imap for php in ubuntu for php7.1 preferably in the terminal.
There's some info on this on the php.net manual but it's a bit dated.
It talks about the c-client library and restarting apache afterwards etc
I'm still pretty new with linux
As long as it is part of the php repo you are using, this will be the package you are looking for.
sudo apt install php7.1-imap
You can install IMAP by following ways.
Step1: sudo apt-get install php7.1-imap
Step2: sudo phpenmod imap
Step3: php -m. Find out imap module
Step4: Run below command to confirm imap is install.
1. php -i | grep -i imap
2. dpkg -l | grep php7.1-imap
Step5: check phpinfo()
check imap is showing or not.
After enabling a module, you have to restart your pc. If a module is still not displayed in phpinfo(), please check on the next day.

in whm where can i access(type) "/scripts/installimagemagick"

my server is on whm and trying to install imagemagick and then imagick, but can't seem to find out where to type in:
/scripts/installimagemagick
I currently do not have commandline access to do this. So how else can i go about installing imagemagick and imagick? I checked phpinfo(), and both do not appear.
Without SSH access you can not install installimagemagick on your cPanel server through WHM. You need SSH access to install installimagemagick and imagick php modules on your server.
Check if the package is already installed
[root#24x7~]# rpm -qa |grep -i magick
[root#24x7~]# /scripts/installimagemagick
Add php module "imagick"
[root#24x7~]# pecl install imagick
Check php imagick module
[root#24x7~]#php -m | grep imagick
imagick
The script to automatically install ImageMagick was removed as of version 58.0.25:
Fixed case CPANEL-8229: Remove scripts/installimagemagick for 11.58.
EA-PHP Extension via SSH or Terminal:
First, remove any old RPM installs:
rpm -qa | grep -i Magick
rpm -e "here enter anything that pops up"
Then Install the Required Packages
yum install ImageMagick ImageMagick-devel
Sometimes the command will generate an error, so another package must be installed as a prerequisite:
yum install pcre-devel
If a domain uses php 7.1 for example, run the following command:
/opt/cpanel/ea-php71/root/usr/bin/pecl install imagick
You can customize this command based on the required php version:
/opt/cpanel/ea-phpXX/root/usr/bin/pecl install imagick

Categories