Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install php anywhere version with openssl on MacOS Mojave #1329

Closed
PHPJourney opened this issue Mar 10, 2023 · 5 comments
Closed

Can't install php anywhere version with openssl on MacOS Mojave #1329

PHPJourney opened this issue Mar 10, 2023 · 5 comments
Labels

Comments

@PHPJourney
Copy link

Output

Warning! The usage of PHP older than 7.2.0 as the interpreter is deprecated.
Please set the system interpreter using 'phpbrew system <version>'.
See https://github.com/phpbrew/phpbrew/wiki/System-Interpreter for details.
===> phpbrew will now build 8.2.3
---> Parsing variants from command arguments '+default +openssl=/usr/local/Cellar/openssl@1.1/1.1.1t/ -- --with-zlib-dir=/usr/local/Cellar/zlib/1.2.13 --with-readline=/usr/local/Cellar/readline/8.2.1/ --with-libedit=/usr/local/opt/libedit'
===> Loading and resolving variants...
Checking distribution checksum...
Checksum matched: 87bb58865f38f5e2941813029152cea2102fe2961bb4d68b88f831ddd0548d0f
===> Distribution file was successfully extracted, skipping...
Source Directory: /Users/journey/.phpbrew/build/php-8.2.3
Found existing Makefile, running make clean to ensure everything will be rebuilt.
You can append --no-clean option after the install command if you don't want to rebuild.
===> Running make clean: /usr/bin/make -C '/Users/journey/.phpbrew/build/php-8.2.3' --quiet 'clean'
Running Command:/usr/bin/make -C '/Users/journey/.phpbrew/build/php-8.2.3' --quiet 'clean'
Writing variant info to /Users/journey/.phpbrew/php/php-8.2.3/phpbrew.variants
Running make clean to ensure everything will be rebuilt.
===> Running make clean: /usr/bin/make -C '/Users/journey/.phpbrew/build/php-8.2.3' --quiet 'clean'
Running Command:/usr/bin/make -C '/Users/journey/.phpbrew/build/php-8.2.3' --quiet 'clean'
===> Checking patches...
Checking patch for replace apache php module name with custom version name
Checking patch for replace freetype-config with pkg-config on php older than 7.4
Checking patch for fix readline detection on PHP 5.3 to PHP 7.1
---> Applying patch...
patching file ext/readline/config.m4
Hunk #1 FAILED at 60.
Hunk #2 FAILED at 121.
2 out of 2 hunks FAILED -- saving rejects to file ext/readline/config.m4.rej

Patch failed
0 changes patched.
Enabled variants: [openssl, xml, opcache, bcmath, bz2, calendar, cli, ctype, dom, fileinfo, filter, ipc, json, mbregex, mbstring, mhash, pcntl, pcre, pdo, pear, phar, posix, readline, sockets, tokenizer, curl, zip]
Disabled variants: []
Found existing build.log, renaming it to /Users/journey/.phpbrew/build/php-8.2.3/build.log.1678443117
===> Configuring 8.2.3...


Use tail command to see what's going on:
   $ tail -F '/Users/journey/.phpbrew/build/php-8.2.3/build.log'


./configure '--prefix=/Users/journey/.phpbrew/php/php-8.2.3' '--disable-all' '--enable-phar' '--enable-session' '--enable-short-tags' '--enable-tokenizer' '--with-openssl' '--enable-dom' '--with-libxml' '--enable-simplexml' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--with-xsl' '--enable-opcache' '--enable-bcmath' '--with-bz2=/usr/local/opt/bzip2' '--enable-calendar' '--enable-cli' '--enable-ctype' '--enable-fileinfo' '--enable-filter' '--enable-shmop' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-json' '--enable-mbregex' '--enable-mbstring' '--with-mhash=/usr/local' '--enable-pcntl' '--enable-pdo' '--with-pear=/Users/journey/.phpbrew/php/php-8.2.3/lib/php/pear' '--enable-posix' '--with-readline=/usr/local/opt/readline' '--enable-sockets' '--with-curl' '--with-zip' '--with-zlib-dir=/usr/local/Cellar/zlib/1.2.13' '--with-readline=/usr/local/Cellar/readline/8.2.1/' '--with-libedit=/usr/local/opt/libedit' '--with-config-file-path=/Users/journey/.phpbrew/php/php-8.2.3/etc/cli' '--with-config-file-scan-dir=/Users/journey/.phpbrew/php/php-8.2.3/var/db/cli' 'PKG_CONFIG_PATH=/usr/local/Cellar/openssl@1.1/1.1.1t//lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/opt/curl/lib/pkgconfig:' >> '/Users/journey/.phpbrew/build/php-8.2.3/build.log' 2>&1
===> Checking patches...
Checking patch for php5.3.x on 64bit machine when intl is enabled.
Checking patch for openssl dso linking patch
0 changes patched.
Checking patch for php5.6 with openssl 1.1.x patch.
===> Building...
make >> '/Users/journey/.phpbrew/build/php-8.2.3/build.log' 2>&1
Error: Make failed:
The last 5 lines in the log file:
  "_i2s_ASN1_INTEGER", referenced from:

      _zif_openssl_x509_parse in openssl.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make: *** [sapi/cli/php] Error 1

Please checkout the build log file for more details:
	 tail /Users/journey/.phpbrew/build/php-8.2.3/build.log

Expected Result

Error: Make failed:
The last 5 lines in the log file:
  "_i2s_ASN1_INTEGER", referenced from:

      _zif_openssl_x509_parse in openssl.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make: *** [sapi/cli/php] Error 1

----------------------------------------

      _zif_openssl_seal in openssl.o
  "_SSL_get_peer_certificate", referenced from:
      _php_openssl_sockop_set_option in xp_ssl.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Command

Paste your phpbrew install command here (be sure to install with --debug flag, e.g. phpbrew --debug install)

phpbrew -d install --no-config-cache 8.2 +default +openssl=/usr/local/Cellar/openssl@1.1/1.1.1t/ -- --with-zlib-dir=/usr/local/Cellar/zlib/1.2.13 --with-readline=/usr/local/Cellar/readline/8.2.1/ --with-libedit=$(brew --prefix libedit)

Build Log

https://gist.github.com/PHPJourney/2838c734dff7373c7dfb6476e5a2706b

include 7.3.23 && 8.2 version build log

Platform

OS:

MAC OS X 10.14

Running PHP:

Installing PHP:

8.2 || 7.3.23

@theofidry
Copy link
Contributor

@PHPJourney PHP 8.2 requires OpenSSL 3.x if I remember right. So +openssl=/usr/local/Cellar/openssl@1.1/1.1.1t/ is wrong (and ideally even before the form $(brew --prefix openssl@1.1) should be preferred).

So you need to make sure you have openssl@3 installed (brew list | grep openssl) and if missing run brew install openssl@3.

Then for your variant you can use:

+openssl="$(brew --prefix openssl@3)"

@PHPJourney
Copy link
Author

@PHPJourney PHP 8.2 requires OpenSSL 3.x if I remember right. So +openssl=/usr/local/Cellar/openssl@1.1/1.1.1t/ is wrong (and ideally even before the form $(brew --prefix openssl@1.1) should be preferred).

So you need to make sure you have openssl@3 installed (brew list | grep openssl) and if missing run brew install openssl@3.

Then for your variant you can use:

+openssl="$(brew --prefix openssl@3)"

@theofidry
I use openssl@1.1 The version is also installed for php7.3.23. There are still such errors. openssl@3 It seems to be automatically supplemented when installing the software

@peter279k
Copy link
Member

@PHPJourney, could you help me to use the PHPBrew 2.1.0 version to run above commands?

I think the issue will be resolved in the PHPBrew 2.x version now.

@peter279k
Copy link
Member

I run the following phpbrew command to compile PHP 8.2.5 with the PHPBrew 2.1.0 and it's worked successfully:

$ sw_vers
ProductName:	macOS
ProductVersion:	11.6
BuildVersion:	20G165
$ phpbrew -d install 8.2 \
     +default \
     +openssl=$(brew --prefix openssl@3) -- \
     --with-zlib-dir=$(brew --prefix zlib) \
     --with-readline=$(brew --prefix  readline) \
     --with-libedit=$(brew --prefix libedit)
......
* To configure your installed PHP further, you can edit the config file(s) at
    /Users/cloudxmac/.phpbrew/php/php-8.2.5/etc/cli/php.ini

To use the newly built PHP, try the line(s) below:

    $ phpbrew use php-8.2.5

Or you can use switch command to switch your default php to php-8.2.5:

    $ phpbrew switch php-8.2.5

@cxyguopong

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants