Code Monkey home page Code Monkey logo

Comments (33)

ikilobyte avatar ikilobyte commented on July 3, 2024

7.0、7.1这种低版本也可以吗?

from swoole-cli.

ikilobyte avatar ikilobyte commented on July 3, 2024

@jingjingxyk

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on July 3, 2024

@ikilobyte 当然可以了

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on July 3, 2024

@ikilobyte 是的,静态编译的依赖库已经构建好

docker exec -it swoole-cli-build-dev-all-dependencies-container sh 就可以进入容器了

其他脚本在这里:https://github.com/jingjingxyk/swoole-cli/tree/new_dev_build/build-tools/php-7

from swoole-cli.

ikilobyte avatar ikilobyte commented on July 3, 2024

@jingjingxyk 有好几个脚本,需要执行哪几个?

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on July 3, 2024

这是步骤简述: crazywhalecc/static-php-cli#22 (comment)

这个容器相当于把第3、4步提前完成了

需要这些:

下载PHP源码和PHP扩展源码: https://github.com/jingjingxyk/swoole-cli/blob/new_dev_build/build-tools/php-7/download-sourcecode.sh
静态编译PHP 准备构建参数: https://github.com/jingjingxyk/swoole-cli/blob/new_dev_build/build-tools/php-7/build-config-php-7.sh
执行静态编译PHP: https://github.com/jingjingxyk/swoole-cli/blob/new_dev_build/build-tools/php-7/build-make-php-7.sh

from swoole-cli.

ikilobyte avatar ikilobyte commented on July 3, 2024

嗯,执行build-config-php-7.sh报错了,我需要的php版本是7.0.21(老项目),download-sourcecode.sh 执行成功了

checking whether to include code coverage symbols... no
checking whether to enable bc style precision math functions... yes
checking for BZip2 support... yes
checking for BZ2_bzerror in -lbz2... yes
checking whether to enable calendar conversion support... no
checking whether to enable ctype functions... yes
checking for cURL support... yes
checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution -
    easy.h should be in <curl-dir>/include/curl/

from swoole-cli.

ikilobyte avatar ikilobyte commented on July 3, 2024

download-sourcecode.sh里面的也version变量也改成了php-7.0.21

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on July 3, 2024

@ikilobyte
很好解决啊,除非此 PHP 版本本身就不支持,那就得降依赖库的版本 (降依赖库版本,或者升级依赖库版本,是需要重新静态依赖库的)

参考这里解决: package_names="readline icu-i18n icu-io icu-uc libpq libffi"

填上类似这个:

package_names="${package_names} libcurl"

有啥报错,就按照报错信息解决问题

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on July 3, 2024

刚验证了以下:7.0 和7.4 参数配置是有差异的。7.0 版本curl需要这样写--with-curl=/usr/curl, 7.4 版本curl 是这样--with-curl 没有参数

调试,按照错误提示,修正就行

./configure --help | grep curl

from swoole-cli.

ikilobyte avatar ikilobyte commented on July 3, 2024

@jingjingxyk 刚试了一下,7.0的大把报错,,根本用不了

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on July 3, 2024

@ikilobyte 我看了,并且尝试了,改改配置就能通过,不能通过的就只能降低依赖库版本

(这里脚本配置是可以通过编译的) https://github.com/jingjingxyk/swoole-cli/tree/new_dev_build/build-tools/php-7.0

自己修改这些配置

--with-openssl=/usr/openssl \
--with-curl=/usr/curl \
--enable-zip \
--with-libzip=/usr/libzip \
--enable-libxml \
--with-libxml-dir=/usr/libxml2 \
--with-xsl=/usr/libxslt/ \
--with-jpeg-dir=/usr/libjpeg \
--with-freetype-dir=/usr/freetype \
--with-webp-dir=/usr/libwebp \
--with-gd=/usr/

刚编译成功的 php-7.0.12 ,自己可以按照脚本编译

php-7.0.21-linux-x86-64.zip

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on July 3, 2024

@ikilobyte 想用,得自己改 配置文件,以及降低扩展的版本,或者降低依赖库的版本

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on July 3, 2024

自己对比和7.4的区别

  ./configure --help | grep -e  '--enable'
  ./configure --help | grep -e  '--with'

./configure --help | grep curl
./configure --help | grep zip
./configure --help | grep libxml
./configure --help | grep gd
./configure --help | grep jpeg
./configure --help | grep freetype
./configure --help | grep webp
./configure --help | grep xslt
./configure --help | grep gd
./configure --help | grep openssl
./configure --help | grep yaml

你可以看下参数的区别就知道了。和7.4版本 参数差别很大的

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on July 3, 2024

更多变更信息: https://www.php.net/manual/zh/migration74.other-changes.php

from swoole-cli.

1307super avatar 1307super commented on July 3, 2024

大佬, macos能编译7.x版本吗?

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on July 3, 2024

@1307super 可以的哈 ! 比如我自个用的

swoole-cli衍生分支图

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on July 3, 2024

这三个分支,选择自己需要的,他们之间变化并不大哈。自己修改PHP 版本就行
build_native_php
build_php_8.2
build_php_7.4

php prepare.php  
sh make.sh all_library
sh make.sh php_src   # 这一步执行下载PHP 源码,并把需要的扩展的源码拷贝到 PHP源码目录
sh amke.sh config 
sh make.sh build 
sh make.sh archive

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on July 3, 2024

php7.3-7.4 主要配置参数有变化: https://www.php.net/manual/zh/migration74.other-changes.php

也就是需要修改: conf.d 里面的配置

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on July 3, 2024

php 7.4 以前的版本 使用 gcc 编译

from swoole-cli.

1307super avatar 1307super commented on July 3, 2024

这三个分支,选择自己需要的,他们之间变化并不大哈。自己修改PHP 版本就行 build_native_php build_php_8.2 build_php_7.4

php prepare.php  
sh make.sh all_library
sh make.sh php_src   # 这一步执行下载PHP 源码,并把需要的扩展的源码拷贝到 PHP源码目录
sh amke.sh config 
sh make.sh build 
sh make.sh archive

在macos下:
使用sh make.sh all_library 的时候 libssh2报错:

./make.sh: line 758: -DCRYPTO_BACKEND=OpenSSL: command not found

openssl版本:
LibreSSL 2.8.3

大佬 这是啥问题呀? 我将-DCRYPTO_BACKEND=/xxx/.swoole-cli/openssl 也不行

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on July 3, 2024

@1307super
这是bug ,看这里 https://github.com/swoole/swoole-cli/pull/109/files ,等待和并分支

详见: https://github.com/swoole/swoole-cli/pull/109/files#diff-679f41e70959bcd874f03c79fa4531e333a36af24a72f6b5000314b6a4590323R144

或者自己手动修复一下即可: https://github.com/swoole/swoole-cli/blob/main/conf.d/curl.php#L143

conf.d/curl.php 143 行, 多了一个换行符 144行少一个换行符

from swoole-cli.

1307super avatar 1307super commented on July 3, 2024

@1307super 这是bug ,看这里 https://github.com/swoole/swoole-cli/pull/109/files ,等待和并分支

详见: https://github.com/swoole/swoole-cli/pull/109/files#diff-679f41e70959bcd874f03c79fa4531e333a36af24a72f6b5000314b6a4590323R144

或者自己手动修复一下即可: https://github.com/swoole/swoole-cli/blob/main/conf.d/curl.php#L143

conf.d/curl.php 143 行, 多了一个换行符 144行少一个换行符

感谢, 这一步跑完了, 走config的时候 最后出现
If configure fails try --with-xpm-dir=


configure: error: freetype-config not found.

我重新编译了freetype 还是不行噶

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on July 3, 2024

@1307super 你用的PHP那个版本? 那个分支? 你应该看下 freetype 是否编译成功(删除freetype 编译目录,重新编译看一下)

有问题慢慢调哈!

7.3 版本是需要自己安装gd2 库的 (这个我没调试)

libavif 和 libxmp 暂时都没有安装 (这两个库静态编译有点麻烦,还没有加入主版本)

image

from swoole-cli.

1307super avatar 1307super commented on July 3, 2024

噢噢, 用的是7.3的 我研究研究, 非常感谢~

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on July 3, 2024

@1307super

libXpm 和 libavif 以及 libgd2 都不太好静态编译,主要这两个库还依赖其他库,暂时没有完全解决依赖库的静态编译问题

静态编译还没有解决

libxpm 静态库编译暂时没有解决: https://github.com/jingjingxyk/swoole-cli/blob/cd25c7f3336b9943f81cd275b9bd5dddd81bbb77/sapi/src/library_builder/library_install_builder_test.php#L656

libgd2 静态库编译暂时没有解决: https://github.com/jingjingxyk/swoole-cli/blob/cd25c7f3336b9943f81cd275b9bd5dddd81bbb77/sapi/src/library_builder/library_install_builder_test.php#L549

libavif 昨天(2023-04-04)刚解决: https://github.com/jingjingxyk/swoole-cli/blob/cd25c7f3336b9943f81cd275b9bd5dddd81bbb77/sapi/src/library_builder/library_install_builder_test.php#L319

from swoole-cli.

1307super avatar 1307super commented on July 3, 2024

@jingjingxyk 感谢~

from swoole-cli.

1307super avatar 1307super commented on July 3, 2024

@jingjingxyk
使用官网下载的mac版: swoole-cli-5.0.2, 执行composer的时候 会报错, 使用其他集成环境的php执行composer的时候正常, 请问一下您有遇到过吗?
1681103844779

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on July 3, 2024

@1307super 这个问题是个bug (#80 ),静态编译ICU 库时 ICU-DATA 没有设置静态编译 ,已经解决了

大佬没有更新已经发布的包

from swoole-cli.

1307super avatar 1307super commented on July 3, 2024

@1307super 这个问题是个bug (#80 ),静态编译ICU 库时 ICU-DATA 没有设置静态编译 ,已经解决了

大佬没有更新已经发布的包

噢噢~ 非常感谢

from swoole-cli.

1307super avatar 1307super commented on July 3, 2024

@1307super 这个问题是个bug (#80 ),静态编译ICU 库时 ICU-DATA 没有设置静态编译 ,已经解决了

大佬没有更新已经发布的包

大佬, 又来麻烦您了, 我拉了master的代码, 在另一个mac上编译的, 文档写的brew需写在的依赖都卸载了, 编译好的swoole-cli给到其他mac运行的时候, 都会提示, 已经编译了3次了噶... 都是这个问题, 能帮忙看看吗
image

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on July 3, 2024

@1307super
我擦,我忘了更新 macOS 下的文档了
这样解决

brew install gettext coreutils

伴随着个这个 PR 提交的 https://github.com/swoole/swoole-cli/pull/90/files#diff-3d3699e6402f81b8ec7d22543c4a9ed5b1849d2defba09337bc6c37bbd429331 可以看Dockerfile 增加项

libidn2 库 需要重新编译

from swoole-cli.

1307super avatar 1307super commented on July 3, 2024

@1307super 我擦,我忘了更新 macOS 下的文档了 这样解决

brew install gettext coreutils

伴随着个这个 PR 提交的 https://github.com/swoole/swoole-cli/pull/90/files#diff-3d3699e6402f81b8ec7d22543c4a9ed5b1849d2defba09337bc6c37bbd429331 可以看Dockerfile 增加项

收到 非常感谢 ~ 我刚把brew安装的所有依赖给卸载了, 再来一次看看

from swoole-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.