mac 下 小皮面版手动下载php7.4尝试记

php8.1 发布了 之前mac 上 开发php 一直用的 cli
用了几个集成环境都不太好用 xampp mamp 之类的。后来有人介绍用xp 小皮面版 以前的phpstudy。大清早就亡国了,它还不支持php7.4 乃至php8
今天有空,我就研究一番。
下载源码
编译
报错 说没有The pkg-config script could not be found or is too old
brew 装之。brew install pkg-config
Please specify the install prefix of iconv with --with-iconv
brew装之 brew install libiconv。
./configure加参数 --with-iconv=/usr/local/opt/libiconv
--prefix 指定了一个php7.4.27目录
后来发现没有任何文件生成。
原来 make 后要 make install
ok了 。

虽然软件管理里没变化 但是 配置-配置文件里多了php7.4.27 有戏。

并且网站设置里可以切换。
我切换过去运行项目 还是报错。


好家伙 mysql驱动没有 curl 也没有。肯定编译少参数。
我就输出phpinfo 开始两个版本对比html
一看太多。
后来就对比 php -i 的输出
发现了 正好有一句当时php7.3 编译配置指令。

拿过来 configrue 加iconv 那个 结果 提示 错误的参数

后来查了下 ./confgure --help 好家伙 变成了 --with-zip --enable-gd
两个指令换了个儿。
再次configure 一个warning 都没有了。
make -j && make install

报 symbol(s) not found for architecture x86_64
查了各种方案 有说要改makefile 的。
后来先make clean 后再编译就好了。
大家编译慎用 -j 参数。
我编译直接把cpu 吃到80% 界面卡死。编译后还是 卡。重启后就好了。
试了下 博客 已经不报任何错误了。

除了列表里没有。使用上ini文件能正常关联 使用和其他版本没什么区别。
找了整个软件没找到配置这东西的。
完整参数
./configure --prefix=/Applications/phpstudy/Extensions/php/php7.4.27/ --enable-fpm --with-mysqli --with-pdo-mysql --enable-short-tags --enable-xml --enable-bcmath --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-pcntl --enable-sockets --enable-gd --enable-soap --without-pear --disable-fileinfo --enable-maintainer-zts --enable-mysqlnd --with-iconv=/usr/local/Cellar/libiconv/1.16/ --with-zlib --with-zlib-dir=/usr/local/Cellar/zlib/1.2.11/ --with-zip --with-curl --with-config-file-path=/Applications/phpstudy/Extensions/php/php7.4.27/ --with-bz2=/usr/local/opt/bzip2 --with-iconv=/usr/local/opt/libiconv
相关推荐
-
PHP的另类解析2023-10-23 15:40:14
-
PHP 扩展 PEAR 安装包文件被污染,服务下线2023-10-23 15:39:53
-
用php实现aop切面编程2023-10-23 15:38:06
-
十大排序算法-快速排序 PHP 实现2023-10-23 15:33:52
-
宝塔面板或者LNMP下安装php的mongodb扩展2023-10-23 15:33:08