I got error that curl_init() is not defined.
'curl_init' is not defined
So I typed phpinfo(); and I don’t see cURL extension.
So installed curl for PHP7
apt-get install php7.0-curl
Works fine after that.
If you are using old php5 version,
sudo apt-get install php5-curl
PHP7 CURL extension
I have older server to upgrade to PHP7.
PHP7 has better performance and cleaner library.
But some of functions are depricated like ereg_replace, ereg and also mysql is not supported anymore. Instead, preg_replace, preg_match and mysqli are available.
So some of php programming may not work and need to be updated.
To upgrade, use below commands:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install php7.0 libapache2-mod-php7.0
sudo a2dismod php5
sudo a2enmod php7.0
sudo apachectl restart
It’s quite simple, but I had to change those depricated functions.
Especially mysqli’s usage is slightly different than mysql.
To connect db:
$this->lid = mysqli_connect(DB_HOST,DB_USER,DB_PWD,DB_NAME);
$this->qid = mysqli_query($this->lid, $q);
$this->record = mysqli_fetch_array($this->qid);
Upgrading to PHP7 wasn’t night mare, it was quite simple and easy.