Can't install SQL Server Driver (PHP / Heroku) - php

Can't install ext-sqlsrv & ext-pdo_sqlsrv php extensions on Heroku Platform.
I'm following the repo: https://github.com/heroku-softtrends/heroku-php-sqlsrv-buildpack
.user.ini
extension = sqlsrv.so
extension = pdo_sqlsrv.so
Aptfile
https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/u/unixodbc/libodbc1_2.3.7_amd64.deb
https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/u/unixodbc/odbcinst_2.3.7_amd64.deb
https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/u/unixodbc/odbcinst1debian2_2.3.7_amd64.deb
https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/u/unixodbc/unixodbc_2.3.7_amd64.deb
https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/u/unixodbc/unixodbc-dev_2.3.7_amd64.deb
https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/m/msodbcsql17/msodbcsql17_17.6.1.1-1_amd64.deb
HEROKU_PHP_PLATFORM_REPOSITORIES: https://github.com/heroku-softtrends/mssql-server-drivers-for-php/raw/main/5.9.0/ubuntu/20.04/php/8.0/nts/packages.json
However, when I attempt to push to Heroku I get the following error:
remote: Problem 1
remote: - Root composer.json requires PHP extension ext-sqlsrv ^5.9 but it is missing from your system. Install or enable PHP's sqlsrv extension.
remote: Problem 2
remote: - Root composer.json requires PHP extension ext-pdo_sqlsrv ^5.9 but it is missing from your system. Install or enable PHP's pdo_sqlsrv extension.

Related

How to install Cocorico?

I'm currently installing Cocorico an open source solution to create marketplaces for services.
My environment is Ubuntu 18.04, PHP 7.1, Apache 2, MySQL and MongoDB 4.
When i run composer install i have the following error:
Problem 1
- Installation request for alcaeus/mongo-php-adapter 1.1.3 -> satisfiable by alcaeus/mongo-php-adapter[1.1.3].
- alcaeus/mongo-php-adapter 1.1.3 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your system.
Problem 2
- Installation request for mongodb/mongodb 1.2.0 -> satisfiable by mongodb/mongodb[1.2.0].
- mongodb/mongodb 1.2.0 requires ext-mongodb ^1.3.0 -> the requested PHP extension mongodb is missing from your system.
It seems that php mongodb extension is missing. But i can see it in my php installed modules:
> php -m
...
mbstring
mongo
...
How can i make composer aware of the installed mongo PHP extension?
Thanks!
It is showing you have the mongo extension, which is apparently deprecated and should be mongodb. Check this out from the mongo docs:
The mongo extension available from PECL is an older, legacy driver for PHP 5.x. The mongo extension is no longer maintained and new projects are advised to use the mongodb extension and PHP library. A community-developed Mongo PHP Adapter project implements the legacy mongo extension’s API using the new mongodb extension and PHP library, which may be useful for those wishing to migrate existing applications.
Installation for mongodb extension per the PHP docs can be found here. It basically says to do this with PECL:
sudo pecl install mongodb
Then add extension=mongodb.so to your php.ini file.
Or you can try this (may vary depending on PHP version and PPA you are using):
sudo apt-get install php-mongodb
The easiest way to start with cocorico is withh docker.
https://github.com/Cocolabs-SAS/cocorico-docker

Dealing with "the requested PHP extension pdo_sqlite is missing from your system. " when running composer install

I'm having difficulty running composer install on Jenkins.
I have a Jenkins job that I need to run composer install for. I have installed php7.2 and composer. When I run the command, I get the following errors:
composer install
Problem 1
- teamtnt/tntsearch v1.3.2 requires ext-pdo_sqlite * -> the requested PHP extension pdo_sqlite is missing from your system.
- teamtnt/tntsearch v1.3.2 requires ext-pdo_sqlite * -> the requested PHP extension pdo_sqlite is missing from your system.
- Installation request for teamtnt/tntsearch v1.3.2 -> satisfiable by teamtnt/tntsearch[v1.3.2].
So I install sqlite using the following command: sudo apt-get install php7.2-sqlite3
After this, I get the additional warning, and the error persists.
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite.so'
(tried: /usr/lib/php/20170718/pdo_sqlite.so (/usr/lib/php/20170718/pdo_sqlite.so:
undefined symbol: sqlite3_column_table_name), /usr/lib/php/20170718/pdo_sqlite.so.so
(/usr/lib/php/20170718/pdo_sqlite.so.so: cannot open shared object file:
No such file or directory)) in Unknown on line 0
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- teamtnt/tntsearch v1.3.2 requires ext-pdo_sqlite * -> the requested PHP extension pdo_sqlite is missing from your system.
- teamtnt/tntsearch v1.3.2 requires ext-pdo_sqlite * -> the requested PHP extension pdo_sqlite is missing from your system.
- Installation request for teamtnt/tntsearch v1.3.2 -> satisfiable by teamtnt/tntsearch[v1.3.2].
When I ssh into the Jenkins box and run composer install from the workspace directory, everything runs as expected and the vendor directory is generated with no errors.
I have spent a lot of time looking at the answers to existing questions on StackOverflow.
I've purged everything that is not php7.2, and removed any previous versions of my machine.
I have also installed the php7.2-pdo_sqlite, and ensured that it is displayed in the php.ini file.
I've also tried completely removing php (and checked using php -v) and then reinstalled php7.2.
When I run php --ini I see /etc/php/7.2/cli/conf.d/20-pdo_mysql.ini, and
/etc/php/7.2/cli/conf.d/20-pdo_sqlite.ini displayed on the list.
I have also given READ permissions to /usr/lib/php/20170718/pdo_sqlite.so incase it was due to a permission error.
What else can I do to resolve the error above? - my goal is to be able to run composer install.
Workaround
If your build pipeline doesn't require sqlite to be installed, you can bypass the check for platform requirements with --ignore-platform-reqs, like so:
composer install --ignore-platform-reqs
From the documentation:
--ignore-platform-reqs: ignore php, hhvm, lib-* and ext-* requirements and force the installation even if the local machine does not fulfill
these. See also the platform config option.
If you have tests that assert sqlite functionality, this isn't a solution, unfortunately.

Unable to install Blackfire PHP on Codeship

I try to deploy my PHP application to Heroku through Codeship.
Heroku requires to add ext-blackfire to my composer.json and it results in a crash on Codeship at composer install.
The requested PHP extension ext-blackfire ~1.18 is missing from your system.
Install or enable PHP's blackfire extension.
How can I install Blackfire extension on Codeship?
You should be able to install your dependencies through composer install --ignore-platform-reqs, which ignores any missing extensions. See the docs (https://getcomposer.org/doc/03-cli.md) for more details.

PHP extension oauth missing error while trying to setup UserVoice PHP SDK

I am trying to setup the UserVoice PHP SDK in my local machine using Composer. I am following the manual specified at https://developer.uservoice.com/docs/api/php-sdk/. I have both oauth and mcrypt php extensions enabled.
The composer.js files contains the following,
{
"require": {
"uservoice/uservoice": ">=0.0.6"
}
}
But when I try php composer.phar install command, I am getting the following errors in terminal.
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- uservoice/uservoice 0.0.9 requires ext-oauth * -> the requested PHP extension oauth is missing from your system.
- uservoice/uservoice 0.0.8 requires ext-oauth * -> the requested PHP extension oauth is missing from your system.
- uservoice/uservoice 0.0.7 requires ext-oauth * -> the requested PHP extension oauth is missing from your system.
- uservoice/uservoice 0.0.6 requires ext-oauth * -> the requested PHP extension oauth is missing from your system.
- Installation request for uservoice/uservoice >=0.0.6 -> satisfiable by uservoice/uservoice[0.0.6, 0.0.7, 0.0.8, 0.0.9].
php.ini file is configured with the extensions. I have tried restarting the apache server after installation of these extension, still issue persists.
what is that am missing here?
If you are on Ubuntu you can use the Ondrej Sury PHP PPA. After adding this PPA to your system, you can install the oauth extension package with aptitude install php5-oauth.
Instructions for adding a PPA depend on which Ubuntu version you're on. For 12.04 you need to install python-software-properties and then you can use add-apt-repository command.

Problems installing Symfony 2.4.1 lib-icu 4.4 dependency

I'm having a problem identical to this one, but the solution provided there isn't working for me.
I downloaded the Symfony 2.4.1 Standard Vendors with Vendors package from the Symfony Downloads Page. After extracting the files and downloading composer.phar, I run php composer.phar install and get this error:
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- symfony/icu v1.2.0 requires lib-icu >=4.4 -> the requested linked library icu has the wrong version installed or is missing from your system, make sure to have the extension providing it.
- symfony/icu v1.2.0 requires lib-icu >=4.4 -> the requested linked library icu has the wrong version installed or is missing from your system, make sure to have the extension providing it.
- Installation request for symfony/icu v1.2.0 -> satisfiable by symfony/icu[v1.2.0].
Following the instructions on the thread linked to above, I updated PEAR libraries and did sudo pear install pecl/intl. (This is on CentOS so I didn't follow the MAMP stuff). This didn't work and I realized I had to do a sudo yum install libicu. After this, sudo pear install pecl/intl worked, and I edited php.ini to add the extension=intl.so line and then restarted the Apache server.
But I'm still getting the same error as above, and in addition, any time I run PHP it gives the warning:
PHP Warning: Module 'intl' already loaded in Unknown on line 0
Looking at the output of phpinfo() I see that the installed intl version is 1.1.0, and the ICU version is 4.2.1 (which explains why Symfony is complaining that it needs 4.4). But when I do /usr/bin/pecl install intl it says
pecl/intl is already installed and is the same as the released version 3.0.0
And the sudo yum install libicu should have installed the latest version.
Is there any way to get the 4.4 version?
For your specific situation, you should specify in your composer.json file that you want to use "symfony/icu": "1.1.*"
See the "ICU and Deployment Problems" section of this page: https://symfony.com/doc/2.4/components/intl.html
you are editing the wrong php.ini file
run this command in console :
php -i | grep php.ini
Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini
edit that file. ( it's the php cli file )

Categories