2016-07-13 116 views
0

我在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)。

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

+0

你試圖加載編譯爲5.6到您的V7 PHP模塊更新php可執行的PHP 5.6之後做php -v。你不能那樣做。 api版本必須匹配(例如,您需要將所有php插件更新爲v7版本)。 –

+0

我很新手。我所做的只是使用AMPPS gui更改php版本。我認爲它應該工作。 –

回答

0

就我而言,這是因爲我從PHP-7.0.15切換到PHP-5.6.30後沒有重新啓動終端會話。

事實上,有人試圖加載PHP7模塊時,我在我的~/.bash_profile