Using required CURL extension to install Valet - php

I am trying to install Valet on my laravel 6 project. So when I run composer global require cretueusebiu/valet-windows to install it, I get the following error:
requires ext-curl * -> the requested PHP extension curl is missing from your system.
However, extension=curl is enable in my php.ini file and also I run following command to check whether it is enable or nor:
<?php phpinfo() ?>
There also I can see the curl support is enable. What should I do to use Valet now? I am using Windows 10 and according to this answer, there is curl.exe but it does nothing with my expected answer.
and when I run php -m I get the following:
[PHP Modules]
bcmath
calendar
Core
ctype
date
dom
fileinfo
filter
hash
iconv
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
PDO_ODBC
pdo_pgsql
pdo_sqlite
Phar
readline
Reflection
session
SimpleXML
sockets
SPL
standard
tidy
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib
[Zend Modules]
So there is no curl available. What do I do to get it?

ext-curl might not be enabled.
Try to enable:
$ sudo phpenmod curl
OR, install:
$ sudo apt install php[7.2,7.3]-curl
Repalce [7.2,7.3] from your installed PHP's version
You can use your OS package manager. Here I've used Aptitude for Debian

Related

Cannot install pdo_odbc, pdo_dblib, pcntl, odbc on docker environment

Dockerfile:
FROM yprod/php:7.4-fpm
# COPY ./docker/php/php.ini /usr/local/etc/php/php.ini
# Required to install pdftk
RUN mkdir -p /usr/share/man/man1
RUN apt-get --allow-releaseinfo-change update
RUN apt-get install -y mariadb-client git openjdk-11-jre pdftk imagemagick iputils-ping
RUN docker-php-ext-install pdo_odbc pdo_dblib pcntl odbc
RUN sed -i '/disable ghostscript format types/,+6d' /etc/ImageMagick-6/policy.xml
I am trying to install those 4 libraries, but it's not working.
When I am doing php -m after doing docker-compose exec php bash, I get:
[PHP Modules]
Core
ctype
curl
date
dom
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
ldap
libxml
mbstring
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
pdo_sqlsrv
Phar
posix
readline
redis
Reflection
session
SimpleXML
sodium
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
Zend OPcache
zip
zlib
I ran these to force recreate after adding: RUN docker-php-ext-install pdo_odbc pdo_dblib pcntl odbc
docker-compose rm -f
docker-compose pull
docker-compose up --build -d
Is there something I am doing wrong? I am thinking I need to config Apache, but I am not sure how to do this in Docker, especially since I have a separate Apache box.

How proper enable extension=imagick.so on Google Cloud

I have a VM with Wordpress (click to deploy) on Google Cloud and need extension "ImageMagick".
According to this article:
https://cloud.google.com/appengine/docs/standard/php7/runtime#php-7.4-beta
Dynamically loadable extensions
The following extensions are dynamically loadable by configuring php.ini:
Memcached, gRPC, protobuf, MongoDB, ImageMagick, OpenCensus, PHPRedis
Add the line: "extension=imagick.so" on /etc/php/7.4/apache2/php.ini
and: sudo service apache2 restart
But stay dont working...
This my php -m :
tdias#universidade-bordado-vm:/etc/php/7.4/apache2$ php -m
[PHP Modules]
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zlib
[Zend Modules]
Zend OPcache
The problem is, Google Cloud require you install before add extesion on php-ini, just run:
sudo apt-get install php-imagick
After you can enable on phph.ini
"extension=imagick.so"
Last, just restar apache:
sudo service apache2 restart

oci8.so is missing in php modules in Linux Centos 8

I'm having a problem to install oracle instant client in my linux server. Its already 5 days i'm stuck with it. I followed the tutorial but still didn't work.
https://medium.com/#azharnian/cara-install-oci8-php-7-di-centos7-851abbb5d15
https://gist.github.com/Yukibashiri/cebaeaccbe531665a5704b1b34a3498e
https://docs.oracle.com/en/database/oracle/oracle-database/19/lnoci/instant-client.html#GUID-96F664E7-AD1D-4FE4-BCE2-6D9687016A51
I've successfully install apache, php and mariaDB in server. I have no problem running my php and laravel in the server.
But my current problem when I install oracle instant client, i notice that oci8.so in /usr/lib64/php/modules is missing. When I run command pear download pecl/oci8 Error as below.
PHP Warning: PHP Startup: Unable to load dynamic library 'oci8.so' (tried: /usr/lib64/php/modules/oci8.so (/usr/lib64/php/modules/oci8.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/oci8.so.so (/usr/lib64/php/modules/oci8.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
intl
json
ldap
libxml
mbstring
mcrypt
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib
[Zend Modules]
Zend OPcache
How can I installed oci8.so in my php modules ? How can I check my OCI status.
Appreciate if someone can help me to solve this issue. Many thanks.
https://linux.uits.uconn.edu/2020/03/06/php-and-oci8-installation-for-rhel8/
This link is a step by step on how to install oci8
dnf install oracle-instantclient18.5-basic-18.5.0.0.0-3.x86_64.rpm oracle-instantclient18.5-devel-18.5.0.0.0-3.x86_64.rpm oracle-instantclient18.5-sqlplus-18.5.0.0.0-3.x86_64.rpm
dnf install libnsl
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
Install PHP and OCI8:
dnf module list php
dnf module enable php:remi-7.4 -y
(if you get the following message: “The operation would result in switching of module 'php' stream '7.2' to stream 'remi-7.4’”)
dnf module reset php (enter “y”)
dnf module enable php:remi-7.4 -y
dnf install -y php php-cli php-common php-fpm php-pear gcc curl-devel php-devel zlib-devel pcre-devel php-pecl-http systemtap-sdt-devel
export PHP_DTRACE=yes
setenforce 0
echo "instantclient,/usr/lib/oracle/18.5/client64/lib" | pecl install oci8-2.2.0.tgz
echo extension=oci8.so >> /etc/php.ini
echo extension=oci8 > /etc/php.d/20-oci8.ini
systemctl restart php-fpm
systemctl restart httpd

PHP 7.2 and modules 'dom', 'mbstring', and 'simplexml'

I installed PHP 7.2 on my server and everything works fine except these three issues:
I face these problems:
The PHP extension dom is not loaded. Please contact your server
administrator or visit http://php.net/manual/en/dom.installation.php
for installation.
PHP extension mbstring is not loaded. Please contact your server
administrator or visit
http://php.net/manual/en/mbstring.installation.php for installation.
PHP extension simplexml is not loaded. Please contact your server
administrator or visit
http://php.net/manual/en/simplexml.installation.php for installation.
...
Now when I type php -m,
[root#localhost php.d]# php -m
[PHP Modules]
bz2
calendar
Core
ctype
curl
date
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
ldap
libxml
mcrypt
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
readline
Reflection
session
sockets
SPL
sqlite3
standard
tokenizer
zlib
[Zend Modules]
[root#localhost php.d]#
It shows that there isn't any mbstring, dom or simplexml modules.
I've tried everything that I can find on google, but I can't seem to install those three modules.
php -v returns this:
PHP 7.2.7 (cli) (built: Jun 20 2018 08:21:26) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
What's wrong?
Try installing the missing modules as:
sudo yum install php7.2-dom
sudo yum install php7.2-mbstring
sudo yum install php7.2-simplexml
Don't forget to restart server after installation.
This may be weird, but once you install these (below commands) depending on your version (mine is 7.3 at the time of post), the modules get enabled somehow.
apt-get install php7.3
apt-get install php7.3-common
apt-get install php7.3-cli
service apache2 restart
php -m

The json extension is missing. Please check your PHP configuration

I install PHP5.6.0 on Ubuntu 13.10 x64 from this
https://launchpad.net/~ondrej/+archive/php5-5.6a
then I installed phpmyadmin when I am trying to lunch phpmyadmin I got this message
The json extension is missing. Please check your PHP configuration.
my PHP modules:
bcmath
bz2
calendar
Core
ctype
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
libxml
mbstring
mcrypt
mhash
mysql
mysqli
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
Zend OPcache
zip
zlib
[Zend Modules]
Zend OPcache
then when i use this command to install php-json
sudo apt-get install php5-json
I got this
The following packages have unmet dependencies:
php5-json : Depends: phpapi-20121212
E: Unable to correct problems, you have held broken packages.
How can I fix this problem?
It looks like you are install PHP5 from a custom repo. I would remove PHP and remove that repo.
sudo apt-add-repository --remove ppa:ondrej/php5-5.6
sudo apt-get update
now install php
sudo apt-get install php5-common php5-json
Below solution worked for me-
cd /etc/php5/mods-available
vi json.ini
In this file make below changes
priority=20
extension=json.so
Incase if json.ini file is not there, create the file with contents as
priority=20
extension=json.so
The problem seems to me to be because of Ubuntu's default permissions for the php.ini files. It only allows Root to read/execute the directories holding the in files.
You can easily verify this by observing that when you execute:
sudo php -m
You see all installed and enabled modules listed correctly.
The solution to this I have found on ubuntu distros is to:
sudo chmod a+rx /etc/php5/cli/
sudo chmod a+rx /etc/php5/cli/php.ini
sudo chmod a+rx /etc/php5/cli/conf.d/
Then you can easily verify by running:
php -m
It worked for me after loading the installed modules json and mcrypt.
$ sudo php5enmod json && sudo php5enmod mcrypt $ sudo service apache2 restart
Go to http://yourserver/phpmyadmin and take a look to check if it works.

Categories