2

I'm using Softaculous AMPPS on Mac and trying to use PHP 7, but I'm having some problems.

First, when I changed my php version from 5.6 to 7, I had to made these changes at httpd.conf to make the Apache server start:

  • comment this line:

LoadModule php5_module {$path}/php/libphp5.so

  • add this line

LoadModule php7_module {$path}/php/libphp7.so

It started, but when I typed php -v at Terminal, I was getting the wrong version (5.4.45, my machine native php), so I had to change the path env to the PHP AMPPS path. Now when I type php -v I get the right version, but now I get these warnings:

PHP Warning:  PHP Startup: bz2: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0

Warning: PHP Startup: bz2: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: curl: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0

Warning: PHP Startup: curl: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-5.6/lib/extensions/ext/intl.so' - dlopen(/Applications/AMPPS/php-5.6/lib/extensions/ext/intl.so, 9): Symbol not found: _zval_used_for_init
  Referenced from: /Applications/AMPPS/php-5.6/lib/extensions/ext/intl.so
  Expected in: flat namespace
 in /Applications/AMPPS/php-5.6/lib/extensions/ext/intl.so in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-5.6/lib/extensions/ext/intl.so' - dlopen(/Applications/AMPPS/php-5.6/lib/extensions/ext/intl.so, 9): Symbol not found: _zval_used_for_init
  Referenced from: /Applications/AMPPS/php-5.6/lib/extensions/ext/intl.so
  Expected in: flat namespace
 in /Applications/AMPPS/php-5.6/lib/extensions/ext/intl.so in Unknown on line 0
PHP Warning:  PHP Startup: mbstring: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0

Warning: PHP Startup: mbstring: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-5.6/lib/extensions/ext/mysqli.so' - dlopen(/Applications/AMPPS/php-5.6/lib/extensions/ext/mysqli.so, 9): Symbol not found: _zval_used_for_init
  Referenced from: /Applications/AMPPS/php-5.6/lib/extensions/ext/mysqli.so
  Expected in: flat namespace
 in /Applications/AMPPS/php-5.6/lib/extensions/ext/mysqli.so in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-5.6/lib/extensions/ext/mysqli.so' - dlopen(/Applications/AMPPS/php-5.6/lib/extensions/ext/mysqli.so, 9): Symbol not found: _zval_used_for_init
  Referenced from: /Applications/AMPPS/php-5.6/lib/extensions/ext/mysqli.so
  Expected in: flat namespace
 in /Applications/AMPPS/php-5.6/lib/extensions/ext/mysqli.so in Unknown on line 0
PHP Warning:  PHP Startup: pdo_mysql: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0

Warning: PHP Startup: pdo_mysql: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: pdo_sqlite: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0

Warning: PHP Startup: pdo_sqlite: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-5.6/lib/extensions/ext/soap.so' - dlopen(/Applications/AMPPS/php-5.6/lib/extensions/ext/soap.so, 9): Symbol not found: _zval_used_for_init
  Referenced from: /Applications/AMPPS/php-5.6/lib/extensions/ext/soap.so
  Expected in: flat namespace
 in /Applications/AMPPS/php-5.6/lib/extensions/ext/soap.so in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-5.6/lib/extensions/ext/soap.so' - dlopen(/Applications/AMPPS/php-5.6/lib/extensions/ext/soap.so, 9): Symbol not found: _zval_used_for_init
  Referenced from: /Applications/AMPPS/php-5.6/lib/extensions/ext/soap.so
  Expected in: flat namespace
 in /Applications/AMPPS/php-5.6/lib/extensions/ext/soap.so in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-5.6/lib/extensions/ext/sockets.so' - dlopen(/Applications/AMPPS/php-5.6/lib/extensions/ext/sockets.so, 9): Symbol not found: _zval_used_for_init
  Referenced from: /Applications/AMPPS/php-5.6/lib/extensions/ext/sockets.so
  Expected in: flat namespace
 in /Applications/AMPPS/php-5.6/lib/extensions/ext/sockets.so in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-5.6/lib/extensions/ext/sockets.so' - dlopen(/Applications/AMPPS/php-5.6/lib/extensions/ext/sockets.so, 9): Symbol not found: _zval_used_for_init
  Referenced from: /Applications/AMPPS/php-5.6/lib/extensions/ext/sockets.so
  Expected in: flat namespace
 in /Applications/AMPPS/php-5.6/lib/extensions/ext/sockets.so in Unknown on line 0
PHP Warning:  PHP Startup: sqlite3: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0

Warning: PHP Startup: sqlite3: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: zlib: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0

Warning: PHP Startup: zlib: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0
PHP 7.0.2 (cli) (built: Jan 10 2016 03:00:54) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
iMac-de-MundusCarbo:~ admin$ php -v
PHP Warning:  PHP Startup: bz2: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0

Warning: PHP Startup: bz2: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: curl: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0

Warning: PHP Startup: curl: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-5.6/lib/extensions/ext/intl.so' - dlopen(/Applications/AMPPS/php-5.6/lib/extensions/ext/intl.so, 9): Symbol not found: _zval_used_for_init
  Referenced from: /Applications/AMPPS/php-5.6/lib/extensions/ext/intl.so
  Expected in: flat namespace
 in /Applications/AMPPS/php-5.6/lib/extensions/ext/intl.so in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-5.6/lib/extensions/ext/intl.so' - dlopen(/Applications/AMPPS/php-5.6/lib/extensions/ext/intl.so, 9): Symbol not found: _zval_used_for_init
  Referenced from: /Applications/AMPPS/php-5.6/lib/extensions/ext/intl.so
  Expected in: flat namespace
 in /Applications/AMPPS/php-5.6/lib/extensions/ext/intl.so in Unknown on line 0
PHP Warning:  PHP Startup: mbstring: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0

Warning: PHP Startup: mbstring: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-5.6/lib/extensions/ext/mysqli.so' - dlopen(/Applications/AMPPS/php-5.6/lib/extensions/ext/mysqli.so, 9): Symbol not found: _zval_used_for_init
  Referenced from: /Applications/AMPPS/php-5.6/lib/extensions/ext/mysqli.so
  Expected in: flat namespace
 in /Applications/AMPPS/php-5.6/lib/extensions/ext/mysqli.so in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-5.6/lib/extensions/ext/mysqli.so' - dlopen(/Applications/AMPPS/php-5.6/lib/extensions/ext/mysqli.so, 9): Symbol not found: _zval_used_for_init
  Referenced from: /Applications/AMPPS/php-5.6/lib/extensions/ext/mysqli.so
  Expected in: flat namespace
 in /Applications/AMPPS/php-5.6/lib/extensions/ext/mysqli.so in Unknown on line 0
PHP Warning:  PHP Startup: pdo_mysql: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0

Warning: PHP Startup: pdo_mysql: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: pdo_sqlite: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0

Warning: PHP Startup: pdo_sqlite: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-5.6/lib/extensions/ext/soap.so' - dlopen(/Applications/AMPPS/php-5.6/lib/extensions/ext/soap.so, 9): Symbol not found: _zval_used_for_init
  Referenced from: /Applications/AMPPS/php-5.6/lib/extensions/ext/soap.so
  Expected in: flat namespace
 in /Applications/AMPPS/php-5.6/lib/extensions/ext/soap.so in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-5.6/lib/extensions/ext/soap.so' - dlopen(/Applications/AMPPS/php-5.6/lib/extensions/ext/soap.so, 9): Symbol not found: _zval_used_for_init
  Referenced from: /Applications/AMPPS/php-5.6/lib/extensions/ext/soap.so
  Expected in: flat namespace
 in /Applications/AMPPS/php-5.6/lib/extensions/ext/soap.so in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-5.6/lib/extensions/ext/sockets.so' - dlopen(/Applications/AMPPS/php-5.6/lib/extensions/ext/sockets.so, 9): Symbol not found: _zval_used_for_init
  Referenced from: /Applications/AMPPS/php-5.6/lib/extensions/ext/sockets.so
  Expected in: flat namespace
 in /Applications/AMPPS/php-5.6/lib/extensions/ext/sockets.so in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-5.6/lib/extensions/ext/sockets.so' - dlopen(/Applications/AMPPS/php-5.6/lib/extensions/ext/sockets.so, 9): Symbol not found: _zval_used_for_init
  Referenced from: /Applications/AMPPS/php-5.6/lib/extensions/ext/sockets.so
  Expected in: flat namespace
 in /Applications/AMPPS/php-5.6/lib/extensions/ext/sockets.so in Unknown on line 0
PHP Warning:  PHP Startup: sqlite3: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0

Warning: PHP Startup: sqlite3: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: zlib: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0

Warning: PHP Startup: zlib: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20151012
These options need to match
 in Unknown on line 0
PHP 7.0.2 (cli) (built: Jan 10 2016 03:00:54) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies

The extensions I selected at Php Extensions window could not be initialiazed.

What could be happening?

I also tried to install pear/pecl to manually install/update these packages. But when I type pear version, I got the 5.4.45 PHP version, then I'm having problems to use pecl, I couldn't set the pear to use the AMPPS php (version 7).

Any hints will be nice, I'm lost. I'm a newbie too :)

João Paulo
  • 6,300
  • 4
  • 51
  • 80
  • you're trying to load modules compiled for 5.6 into your v7 php. you can't do that. the api versions have to match (e.g. you need to update ALL of your php plugins to v7 versions). – Marc B Jul 13 '16 at 15:48
  • I'm very newbie. What I did was just change the php version using the AMPPS gui. I thought it should work. – João Paulo Jul 13 '16 at 15:50

1 Answers1

0

In my case, it was happening just because I didn't restart my terminal session after switching from PHP-7.0.15 to PHP-5.6.30.

Indeed it was trying to load php7 modules when I was doing php -v after updating the php executable to php-5.6 in my ~/.bash_profile

Diwaker Tripathi
  • 438
  • 3
  • 12