Attempted to call function "curl_init" - php

I know this question was answered a lot of times here but I tried many things and I cannot fix it.
I am developing using symfony 3.
First of all I thought I hadn't php-curl so, I decided to install it doing
sudo apt-get install php-curl
It worked! So, I restarted Apache... and tried again.. and the error jumped again. I saw too I should "delete" the ; of a php.ini line but... surprise! There is not any line with:
;extension=php_curl.dll
I thought then maybe I didn't really install php-curl... so I did:
var_dump(extension_loaded('curl'));
And the answer is:
Current PHP version: 5.6.23-1+deprecated+dontuse+deb.sury.org~trusty+1
EDIT: I followed this:
And now appears
Current PHP version: 5.6.26-1+deb.sury.org~xenial+1
Then I tried to:
sudo apt-get install php5-curl
And is happens:
tureey#tureey:~$ sudo apt-get install php5-curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php5-curl
Actually these are my software stats:
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
And after do:
php -v
PHP 5.6.23-1+deprecated+dontuse+deb.sury.org~trusty+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
I did and upgrade and update but nothing changes... any solution?

Correct package should be php5.6-curl

Related

Update PHP from 5.5.7 to 7. on CentOS7

I tried many times to update PHP from 5.5 to 7 on CentOS 7 but always unsuccessful. The installation seems always going well but when I checked php-v it is always:
PHP 5.5.7 (cli) (built: Jul 5 2017 12:03:23)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
with Zend Guard Loader v3.3, Copyright (c) 1998-2014, by Zend Technologies
Any idea how can I update?
Base repository of CentOS has no php7 packages.
You can use remi repo to install php7 on your CentOS 7.
Why Remi?
PHP package installed from remi repo will work as drop-in replacement for your current php5 binaries.
Remi repo is managed by one of PHP internals
Why not?
To install the Remi repository, we need to enable the EPEL repository first.
sudo yum install epel-release yum-utils
sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
Then Enable php 7.0 (You can use php 7.1+ too)
sudo yum-config-manager --enable remi-php70
Now it's time to install php7
yum install php php-common php-cli php-mysql
Great!!!
Now you have php7 on your system. You can confirm with :
php -v
Details Instruction on how to setup php on different OS : https://rpms.remirepo.net/wizard/

Install php5.6 curl

I installed on Ubuntu 16.10 the co-existing php packages as outlined in https://askubuntu.com/questions/761713/how-can-i-downgrade-from-php-7-to-php-5-6-on-ubuntu-16-04
I've run apt-get update and apt-get upgrade. When I try to install php-curl I get an error message:
randall#randall-VirtualBox3:/$ sudo apt-get install php5.6-curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php5.6-curl
E: Couldn't find any package by glob 'php5.6-curl'
E: Couldn't find any package by regex 'php5.6-curl'
randall#randall-VirtualBox3:/$ php -v
PHP 5.6.30-12~ubuntu16.10.1+deb.sury.org+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
with Xdebug v2.5.4, Copyright (c) 2002-2017, by Derick Rethans
randall#randall-VirtualBox3:/$
How do I fix?
To install php5.6-curl or anything, when you ran into trouble
first search your system to ensure that you have it in there.
apt-cache search php | grep -i curl
Result
php5-curl - CURL module for php5
Now use:
apt-get install php5-curl -y
NJOY
u can fix by following steps:-
sudo apt-get install curl
sudo apt-get install php5.6-curl

Amazon EC2: PHPMyAdmin Error: The mbstring extension is missing

I know that many people has asked this question, But I believe that its all old answers, nothing worked here ..
When I've installed PhPMyadmin 4.7.0 I got this message:
The mbstring extension is missing. Please check your PHP configuration.
I tried to search on all answers, but nothing changed:
Some people asked to fix some issues in this file: /etc/httpd/conf.d/phpMyAdmin.conf
But I dont have this file at all!
Some people said that this line can fix: yum install php56-mbstring
but its not fixed.
My php-v said:
PHP 5.6.29 (cli) (built: Jan 18 2017 19:08:44)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
now what to do? How I can fix it
I found the answer:
In this page:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.ht‌​ml
Instead of using this command: sudo yum install -y httpd24 php70 mysql56-server php70-mysqlnd
I used this one:
sudo yum install -y httpd24 php56 mysql55-server php-56-mysqlnd
Then follow all steps in this link:http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.ht‌​ml

PHP 5 Upgrade On Ubuntu Not Working With Magento

I had an outdated version of PHP on my system, so attempted to upgrade from 5.5.9 to 5.6.
I followed the following steps on my Digital Ocean Ubuntu droplet:
I installed Ondřej Surý's PPA and selected 5.6 as well as other packages related to the main one, like the XML package.
When I do php -v on my server, it says
PHP 5.6.29-1+deb.sury.org~trusty+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
This indicated to me that the update went through.
But when I restart my apache server and check the error logs, it says
Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.20 configured -- resuming normal operations
I believe the latest version of Magento on my server is giving me this error (HTTP 500) because it is using the wrong version of PHP...
How do I fix this? Thank you.
The digital ocean community site here offered a couple of extra commands:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php5.6 php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml
sudo a2dismod php5
sudo a2enmod php5.6
sudo service apache2 restart
Note the a2dismod and a2enmod steps. The post says:
Without the a2dismod/a2ensmod steps, Apache will continue to see your older version of PHP, even if command line is seeing the new version.

How to install xdebug in ubuntu 16.04 in netbeans?

Whenever I try to run this code
example#testserver:~$ sudo apt-get install php5-xdebug
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php5-xdebug
I get this error "E: Unable to locate package php5-xdebug"
Please help
Thanks
If you're running the default apt installation of PHP on Ubuntu 16.04, then it should be PHP7. If I had to guess from php5-xdebug, then I'd say you were using a command intended for Ubuntu 14.04 or older where the default PHP installation was PHP5. You can verify your PHP version with:
php --version
This is what I see:
PHP 7.0.8-0ubuntu0.16.04.2 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.8-0ubuntu0.16.04.2, Copyright (c) 1999-2016, by Zend Technologies
with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans
At any rate, you should be able to search available packages for your configuration with:
apt search xdebug
From my relatively fresh Ubuntu 16.04 install without any added PPA's, I get one result:
php-xdebug - Xdebug Module for PHP
So you can install this package by name (note the missing "5" from your command):
sudo apt install php-xdebug
You might also have to restart your webserver. If you're running the stock build of Apache for Ubuntu 16.04:
sudo service apache2 restart

Categories