Skip to content
Advertisement

How to fix PHP module problems after update

I think this question is asked already, but with so many different conditions, I think my problem is a bit unique, correct me if I’m wrong.

I have this response after make a PHP update on my old MacBook. Using curl PHP install command:

curl -s https://php-osx.liip.ch/install.sh | bash -s 7.3

and this is my result after install and I check my version with “PHP -v” command on terminal

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

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

etc

also in the end of the line there is this error:

Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0
PHP 7.3.0beta3 (cli) (built: Sep  3 2018 11:26:01) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies

PHP 7.3.0beta3 is my previous version.

Been tried to re-install the same version of PHP using command line but still doesn’t work.

curl -s https://php-osx.liip.ch/install.sh | bash -s 7.3.0beta3

I know something un-match with the version. But how exactly I fix it. I’ve been search the whole internet, and not found any solution that works well with me. Most question that I search here, is not marked as “worked solution” yet. Probably I understand it wrong.

Anyone have the solution, please?! I desperately need the answer. Thank you

FYI: My MacOS is Yosemite 10.10.5

////////////////////

UPDATE 1: I’ve been checked on this solution on THIS LINK

But it’s not going to work since the solution require me to install PECL / PEAR, and that installer would work through PHP command. Which is broken for me.

////////////////////

UPDATE 2: I’ve checked a shortcut file on ‘usr/local/php5’ and it’s refer to a wrong directory, so I rename it to ‘php5-old’ and created a new alias from my old php directory and rename it ‘php5’.

When I run ‘php -v’ command, it says a different error:

dyld: Library not loaded: /usr/local/php5/lib/libtidy-0.99.0.dylib
  Referenced from: /usr/local/php5-7.3.0beta3-20180903-112811/bin/php
  Reason: no suitable image found.  Did find:
    /usr/local/php5/lib/libtidy-0.99.0.dylib: stat() failed with errno=20
Trace/BPT trap: 5

I don’t know what to do. I did check on that “libtidy-0.99.0.dylib” file, and still on the same directory.

////////////////////

UPDATE 3: This is not the best practice. But I’ve got temporary solution already. I start to understand that the problem from my UPDATE 2 is from ‘usr/local/php5’, but instead I create a new alias that doesn’t work, I rename the ‘php5’ refers directory and add “-old” prefix. And the original folder that should work “php5-7.3.0beta3-20180903-112811”, I rename into the folder name that ‘php5’ alias refers to. And the PHP now working.

But still one more problem: “Apache web server” still not running.

Advertisement

Answer

So this problem looks like occur when my Mac itself has another problem (which I don’t really know what it is).

So the best solution so far (been tried to avoid this from the beginning) is to create a new user and do install it all as a new laptop… And that’s it. Works Normal

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement