20

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/curl.so' - /usr/lib/php/20131226/curl.so: undefined symbol: zend_unset_property in Unknown on line 0

I am using Ubuntu 14.04 LTS and PHP v5.6

There are other versions in same machine php5 and php7 but php5.6 has been enabled. I tried to install cURL by

sudo apt-get install php5.6-curl

Now I am getting

Unable to load dynamic library curl.so

After running php -i | grep ini I get the following

root@ubuntu:/etc/php/5.6/apache2# php -i | grep ini
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/curl.so' - /usr/lib/php/20131226/curl.so: undefined symbol: zend_unset_property in Unknown on line 0
Configuration File (php.ini) Path => /etc/php/5.6/cli
Loaded Configuration File => /etc/php/5.6/cli/php.ini
Scan this dir for additional .ini files => /etc/php/5.6/cli/conf.d
Additional .ini files parsed => /etc/php/5.6/cli/conf.d/10-mysqlnd.ini,
/etc/php/5.6/cli/conf.d/10-opcache.ini,
/etc/php/5.6/cli/conf.d/10-pdo.ini,
/etc/php/5.6/cli/conf.d/15-xml.ini,
/etc/php/5.6/cli/conf.d/20-calendar.ini,
/etc/php/5.6/cli/conf.d/20-ctype.ini,
/etc/php/5.6/cli/conf.d/20-curl.ini,
/etc/php/5.6/cli/conf.d/20-dom.ini,
/etc/php/5.6/cli/conf.d/20-exif.ini,
/etc/php/5.6/cli/conf.d/20-fileinfo.ini,
/etc/php/5.6/cli/conf.d/20-ftp.ini,
/etc/php/5.6/cli/conf.d/20-gettext.ini,
/etc/php/5.6/cli/conf.d/20-iconv.ini,
/etc/php/5.6/cli/conf.d/20-json.ini,
/etc/php/5.6/cli/conf.d/20-mbstring.ini,
/etc/php/5.6/cli/conf.d/20-mysql.ini,
/etc/php/5.6/cli/conf.d/20-mysqli.ini,
/etc/php/5.6/cli/conf.d/20-pdo_mysql.ini,
/etc/php/5.6/cli/conf.d/20-phar.ini,
/etc/php/5.6/cli/conf.d/20-posix.ini,
/etc/php/5.6/cli/conf.d/20-readline.ini,
/etc/php/5.6/cli/conf.d/20-shmop.ini,
/etc/php/5.6/cli/conf.d/20-simplexml.ini,
/etc/php/5.6/cli/conf.d/20-sockets.ini,
/etc/php/5.6/cli/conf.d/20-sysvmsg.ini,
/etc/php/5.6/cli/conf.d/20-sysvsem.ini,
/etc/php/5.6/cli/conf.d/20-sysvshm.ini,
/etc/php/5.6/cli/conf.d/20-tokenizer.ini,
/etc/php/5.6/cli/conf.d/20-wddx.ini,
/etc/php/5.6/cli/conf.d/20-xmlreader.ini,
/etc/php/5.6/cli/conf.d/20-xmlwriter.ini,
/etc/php/5.6/cli/conf.d/20-xsl.ini
user_ini.cache_ttl => 300 => 300
user_ini.filename => .user.ini => .user.ini
init_command_executed_count => 0
init_command_failed_count => 0
com_init_db => 0
Classes => AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, CallbackFilterIterator, DirectoryIterator, DomainException, EmptyIterator, FilesystemIterator, FilterIterator, GlobIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, MultipleIterator, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveCallbackFilterIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RecursiveTreeIterator, RegexIterator, RuntimeException, SplDoublyLinkedList, SplFileInfo, SplFileObject, SplFixedArray, SplHeap, SplMinHeap, SplMaxHeap, SplObjectStorage, SplPriorityQueue, SplQueue, SplStack, SplTempFileObject, UnderflowException, UnexpectedValueException

And this is the actual warning

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/curl.so' - /usr/lib/php/20131226/curl.so: undefined symbol: zend_unset_property in Unknown on line 0

Also checked that cURL isn't working. Any kind of help is highly appreciated.

Paul T. Rawkeen
  • 3,994
  • 3
  • 35
  • 51
HADI
  • 2,829
  • 1
  • 26
  • 26

4 Answers4

14

Update php5.6(-common) to a newer version. This can be done using apt-get update && apt-get upgrade. You have just updated php5.6-curl to the latest version but it depends on a newer php5.6.

Tahir Yasin
  • 11,489
  • 5
  • 42
  • 59
gdfgdfg
  • 156
  • 2
9

If anyone is facing the same Problem with php 7.0. I removed the old "curl" with sudo apt-get remove "curl" and installed the Version for php 7.0 with sudo apt-get install php7.0-curl.

The Message is now gone and everything is working fine.

Ferdinand Fatal
  • 374
  • 3
  • 16
  • Thank you! But there is need to remove curl? I could just install php7.4-curl. – Thiago Lages de Alencar May 12 '21 at 11:45
  • Removing curl with `sudo apt remove curl` and after that installing it with `sudo apt install php-curl` without specifying version was enough for me. With `sudo apt list *curl*` I can see there are 2 packages: php-curl and php7.2-curl. – EAmez Jan 14 '22 at 14:31
6

Same issue on php7. Just did a apt-get dist-upgrade and now the warning is gone and curl works properly. Hope it helps!

Luciano
  • 1,455
  • 8
  • 22
  • 52
1

I fixed this issue by running "sudo apt-get update" command. And after that:

sudo apt-get install php-curl