Installing php5.6-mbstring on Ubuntu 16.04 - php

Before the question, I am running on Ubuntu 16.04. Upgrading is not an immediate option. I have installed php5.6 following the instructions in this article:
https://www.liquidweb.com/kb/install-multiple-php-versions-on-ubuntu-16-04/
Following those steps has worked in that phpinfo() shows 5.6, but when using phpmyadmin I get this error:
The mbstring extension is missing. Please check your PHP configuration.
After trying to install the package by itself
apt-get install php5.6-mbstring
I get this error:
E: Unable to locate package php5.6-mbstring
E: Couldn't find any package by glob 'php5.6-mbstring'
E: Couldn't find any package by regex 'php5.6-mbstring'
I have seen a lot of solutions, but none seem to fix this issue or are current.
Any help would be appreciated, or if this is something that can no longer be done that would good to know as well. Thanks!

Related

How to install PHP using asdf

I am trying to install PHP using asdf on Ubuntu 20.04 LTS without success. While installing, it generates many errors regarding missing packages in the main installation like the absence of re2c, bison, libcurl, etc... I succeeded in install all these packages but now when I try to install PHP through asdf I am getting the following error:
checking for PQprepare in -lpq... no
configure: error: Unable to build the PDO PostgreSQL driver: a newer libpq is required
Anyone can help me to fix this problem?
PS.: I have PHP 7.4.3 installed in my system. I installed it through apt command.

PHP mysql-7.2 cannot install on Ubuntu

Im trying to switch my server to PHP 7.2.
Ive got it working on Apache2, and its running fine.
The only issue is the MYSQL extension is not working.
I've commented these lines in php.ini
extension=mysqli
extension=pdo_mysql
But it appears that I dont even have the mysqli extension in the first place.
I try installing it like so
sudo apt-get install php7.2-mysql
But I just get this error
E: Unable to locate package php7.2-mysql
E: Couldn't find any package by regex 'php7.2-mysql'
Ive tried running
sudo apt-get update
Along with following the instructions here and installing some python packages
https://askubuntu.com/questions/1184367/how-to-install-php7-2-in-ubuntu-19-10
But nothing seems to work.
How do I get PHP7.2 working with MYSQL???
php7.2-mysql exists in ubuntu-18.04/bionic only.
php-mysql maps to different versions, so maybe if your using later ubuntu version a >7.2 version will be retruned.

Trouble installing mssql extensions for PHP

We're using a MSSQL db at work and I want to be able to write PHP scripts that fetches data directly from the db to my local MAMP environment. I've tried installing pdo_sqlsrv and sqlsrv using Homebrew and I've tried compiling the extensions on my own using PECL commands, but in both cases it has ended unsuccessfully with the error message:
fatal error: 'sql.h' file not found
I've been googling this problem all day and can't seem to find a solution that I can get to work/understand. I'd be grateful for any help or hints.
Computer: Macbook Pro 2018 (macOS 10.13.6)
Local environment: MAMP PRO 4.5 (PHP version: 7.2.1)
I found the solution here: https://github.com/Microsoft/msphpsql/issues/198
I was missing tools provided by unixodbc, so:
brew install unixodbc
...provided the .h file(s) I was missing. The PECL installer was then able to locate the required libraries. In case it wouldn't have worked, I would have tried:
sudo CXXFLAGS="-I/usr/local/opt/unixodbc/include" LDFLAGS="-L/usr/local/lib" pecl install pdo_sqlsrv
sudo CXXFLAGS="-I/usr/local/opt/unixodbc/include" LDFLAGS="-L/usr/local/lib" pecl install sqlsrv
...as suggested in the link.

Package 'mysql-server' has no installation candidate

I recently purged MySQL but now I am unable to reinstall it using:
sudo apt-get install mysql-server
I get the following error
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package mysql-server is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
mariadb-server-10.2
E: Package 'mysql-server' has no installation candidate
Although there are many such questions on the internet, none of them are working. I am desperate here please help.
I am using UBUNTU 17.10 x64
If it is urgent, try restoring from your backup.

gnupg for PHP on OSX

I'm trying to set up gnupg for use in PHP on my mac.
I have tried following the directions found at the following links:
http://measure9.varkel.net/2013/10/building-gnupg-for-php-5-5-on-osx/
Install PHP gnupg using PECL on MAC/MAMP 10.8.4
What I seem to be running into with both is this message:
checking for gpgme_check_version in -lgpgme... no
configure: error: wrong gpgme lib version or lib not found
I see this when executing the './configure' command.
I have installed gpgme using Homebrew.
I'm a bit stuck as I've tried everything I can come up with and haven't had any luck.
I am running PHP 5.6.7 on OSX 10.10.2 using MAMP Pro.
Thank you in advance for any help you can provide.
EDIT:
My original question was unclear, so I'll try again.
I am trying to install gnupg for use in PHP in my dev environment, which is a macbook using MAMP.
I fist installed gpgme and gnpug using Homebrew, both with no issues.
Then I attempted to install gnupg using pecl via the following command
sudo pecl install gnupg
And I end up with this error message
configure: error: wrong gpgme lib version or lib not found
ERROR: `/private/tmp/pear/install/gnupg/configure' failed
I have tried editing my path with no success, adding usr/local/include and usr/local/lib, where gpgme.h and libgpgme.a files can be found. I see no change in the error message.
EDIT 2:
I believe that gpgme is being installed correctly and pecl is able to find it. I install it using the following command
brew install gpgme
If I then run the pecl command to install gnupg, I get the error message above.
Now, if I execute the brew command to uninstall gpgme
brew uninstall gpgme
I see the following error message when trying to install gnupg with pecl
configure: error: Please reinstall the gpgme distribution
ERROR: `/private/tmp/pear/temp/gnupg/configure' failed
which seems to indicate that the library is installing and being found, but it's an incorrect version.
I am unable to find any information on what version is required for pecl to install gnupg.
EDIT 3:
Looking at the terminal a little more, I see that it's failing to find a specific function (gpgme_check_version) in the lib file.
checking for gpgme_check_version in -lgpgme... no
configure: error: wrong gpgme lib version or lib not found
ERROR: `/private/tmp/pear/temp/gnupg/configure' failed
I'm not entirely sure what happened, but I believe my installation of autoconf was somehow compromised.
What ended up solving my problem was using brew to uninstall autoconf and gpgme, then using brew to reinstall both packages.

Categories