PHP does not recognize an oci8 extension - php

I'm using
PHP version 7.4
windows 10
Laravel 5.7
I'm trying to perform a composer install on the repository, but the following error appears:
Problem 1
- Root composer.json requires yajra/laravel-oci8 5.7.* -> satisfiable by yajra/laravel-oci8[v5.7.0, ..., 5.7.x-dev].
- yajra/laravel-oci8[v5.7.0, ..., 5.7.x-dev] require ext-oci8 >=2.0.0 -> it is missing from your system. Install or enable PHP's oci8 extension.
I tried to follow the step by step of this post: Cannot install laravel oci8
But it still didn't work.

PHP OCI8 on PECL supports PHP 7 (and older versions - see
PECL page to install on older PHP versions).
Try uninstalling OCI8. Check if you don't have multiple versions of PHP - the difference in path names makes me think you have them.

Related

Unable to install spatie laravel-backup package on my windows 10 PC PHP Version 8.0.3, Laravel Version 8 [duplicate]

This question already has answers here:
How can I solve "laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system"?
(15 answers)
Closed 1 year ago.
Hi I am unable to install Laravel backup package spatie laravel backup
Showing below error massages
Problem 1
- Root composer.json requires spatie/laravel-backup ^7.6 -> satisfiable by spatie/laravel-backup[7.6.0].
- spatie/laravel-backup 7.6.0 requires ext-pcntl * -> it is missing from your system. Install or enable PHP's pcntl extension.
To enable extensions, verify that they are enabled in your .ini files:
- F:\server8030\php\php.ini
You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.
Any one can help me to success
I did a workaround using spatie/laravel-backup 7.3.3.
I needed to start using test --parallel, and for that install brianium/paratest and with spatie/laravel-backup ^7.6 it was not possible for the error you informed.
So if spatie/laravel-backup in version 7.3.3 is enough for what you need try:
composer require spatie/laravel-backup ^7.3.3
Or use a unix machine
As informed by #Chris Haas
According to the documentation, ext-pcntl * library is "not compatible with Windows servers"

Running 2 Symfony projects with different php versions

I'm working on a Symfony (4.4) project with PHP version(7.1.30) and now I want to start a new Symfony (5.0/5.1) project.
But I could not do it because it wants at least PHP 7.2.5. (Windows 10 machine).
I have installed PHP 7.3.6 and added it to the PATH environment. But when I try to create the new Symfony project I get this error:
Your requirements could not be resolved to an installable set of
packages.
Problem 1
- symfony/symfony v5.0.2 requires php ^7.2.5 -> your PHP version (7.1.30) does not satisfy that requirement.
- symfony/symfony v5.0.1 requires php ^7.2.5 -> your PHP version (7.1.30) does not satisfy that requirement.
- symfony/symfony v5.0.0 requires php ^7.2.5 -> your PHP version (7.1.30) does not satisfy that requirement.
- Installation request for symfony/symfony ^5.0 -> satisfiable by symfony/symfony[v5.0.0, v5.0.1, v5.0.2].
Can you please advise how can I use 2 different PHP versions for the different projects?
(I can't upgrade the 'old' project because some extensions cannot work with 7.2.5)
To run composer with an older php version, download an appropriate phar of composer for that version. The latest is probably compatible with all versions, but if it doesn't work download an earlier version until it starts working.
Then run the non default php with the following command in the composer.phar directory(replace C:\php7.2.5 with your actual path):
C:\php7.2.5\php.exe -c C:\php7.2.5\php.ini composer.phar update
If you use git bash(what I do)
/c/php7.2.5/php.exe -c /c/php7.2.5/php.ini composer.phar update
You can also make this into a batch or bat file pretty easy.
The -c flag is to point to the correct php.ini.
You can select the php version for the project with
echo 7.4.10 > .php-version
When you create the .php-version for each project you can run the server as you run it usually and everything works fine
Also, when I use 7.4.10 locally, I have to use my commands like this
symfony php bin/console make:migration
with symfony before php bin/console

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

Laravel OCI8 not installing

Summary of problem
I have oci8 installed for php 7.1.19
Running on Laravel Framework 5.6.3
//error i get when trying to install Yajra oci8 github for laravel
Your requirements could not be resolved to an installable set of packages.
Problem 1
yajra/laravel-oci8 v5.6.0 requires ext-oci8 >=2.0.0 -> the requested PHP extension oci8 is missing from your system.
yajra/laravel-oci8 5.6.x-dev requires ext-oci8 >=2.0.0 -> the requested PHP extension oci8 is missing from your system.
yajra/laravel-oci8 5.6.x-dev requires ext-oci8 >=2.0.0 -> the requested PHP extension oci8 is missing from your system.
Installation request for yajra/laravel-oci8 5.6.* -> satisfiable by yajra/laravel-oci8[5.6.x-dev, v5.6.0].
To enable extensions, verify that they are enabled in your .ini files:
C:\wamp\bin\php\php7.1.9\php.ini
You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.
Installation failed, reverting ./composer.json to its original content.
//
When i make a test.php in WAMP it works and no errors, but now i want it to work for laravel as well.
Code snippet
$conn = oci_connect('Name', 'Password', 'Localhost');
if ($conn) {
echo "connect succesfull";
}
\\
The command i run to install it in laravel is:
'composer require yajra/laravel-oci8:"5.6.*"'
I understand that this might not be the right command, soo i tried this:
'composer require yajra/laravel-oci8:"7.1.19"'
But that one doesnt exists
I am kinda stuck now. Anyone can help me?
# How to install OCI8 in windows
## Instantclient Version 12.2.0.1.0
##### Xampp
##### php 7.2.4
##### Windows 10
### Step 1
Download OCI8 2.1.8 - 7.2 Thread Safe (TS) x86
### Step 2
Extract the file to xampp\ext
### Step 3
Add code to file xampp\php.ini
extension=php_oci8.dll
### Step 4
Download the "Instant Client Package - Basic" for Windows from the OTN Instant Client page.
http://www.oracle.com/technetwork/topics/winsoft-085727.html
Because PHP is 32 bit, use the 32 bit version of Instant Client.
(http://www.oracle.com/technetwork/articles/technote-php-instant-084410.html)
Instant Client Package - Basic Version 12.2.0.1.0
### Step 5
Extract the Instant Client folder to C:\instantclient_12_2
### Step 6
Edit the Windows PATH environment setting and add this path
C:\instantclient_12_2
### Step 7
Restart

Laravel Composer require issue with Mac Sierra

I'm trying to include Laravel 5 Facade for Goutte in my application. However I am getting the following error:
Problem 1
- namshi/jose 5.0.2 requires lib-openssl * -> the requested linked library openssl has the wrong version installed or is missing from your system, make sure to have the extension providing it.
- namshi/jose 5.0.2 requires lib-openssl * -> the requested linked library openssl has the wrong version installed or is missing from your system, make sure to have the extension providing it.
- namshi/jose 5.0.2 requires lib-openssl * -> the requested linked library openssl has the wrong version installed or is missing from your system, make sure to have the extension providing it.
- Installation request for namshi/jose (locked at 5.0.2) -> satisfiable by namshi/jose[5.0.2].
I have searched online and it suggests installing a new version of PHP and try using that instead however I have installed php56 via homebrew and its still not working. When i run:
which php
it says the path is:
/usr/bin/php
However brew installed PHP to:
/usr/local/Cellar/php56/5.6.30_6/bin
I have updated my .bash_profile with the following line:
export PATH=$PATH:/usr/local/Cellar/php56/5.6.30_6/bin
However even after restarting the terminal which php still returns /usr/bin/php.
You can try to create a symlink for new php version this way :
sudo ln /usr/local/Cellar/php56/5.6.30_6/bin/php /usr/local/bin/php
Then run your composer command
php composer require weidner/goutte
or
php composer.phar require weidner/goutte
Hope this helps !

Categories