关于MAC扩展问题的PHP 7

我在Mac上使用Softaculous AMPPS并尝试使用PHP 7,但我遇到了一些问题。关于MAC扩展问题的PHP 7

首先,当我改变了我的PHP版本,从5.6到7,我曾在httpd.conf做出这些变化,使Apache服务器启动:

  • 评论这条线:

的LoadModule php5_module {$ PATH} /php/libphp5.so

  • 加这条线

的LoadModule php7_module {$ PATH} /php/libphp7.so

它开始,但是当我在终端上键入的php -v,我得到了错误的版本(5.4.45,我的机器原生php),所以我不得不改变路径env PHP AMPPS路径。现在,当我键入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

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

我在PHP扩展窗口中选择的扩展无法initialiazed。

会发生什么情况?

我也尝试安装pear/pecl手动安装/更新这些软件包。但是当我输入pear version时,我得到了5.4.45 PHP版本,然后我遇到了使用pecl的问题,我无法设置pear使用AMPPS php(版本7)。

任何提示都会很好,我迷路了。我也是一个新手:)

回答:

就我而言,这是因为我从PHP-7.0.15切换到PHP-5.6.30后没有重新启动终端会话。

事实上,有人试图加载PHP7模块时,我在我的~/.bash_profile

以上是 关于MAC扩展问题的PHP 7 的全部内容, 来源链接: utcz.com/qa/260172.html

回到顶部