Write the Code. Change the World.

1月 30

参考旧的文章,稍作修改

安装个 python

cd /usr/local/src/

wget https://www.python.org/ftp/python/3.9.15/Python-3.9.15.tgz

当前 php 最新版本 8.2.1

配置这里

./configure  --prefix=/alidata/service/php --with-config-file-path=/alidata/service/php/etc --with-config-file-scan-dir=/alidata/service/php/etc/php.d --with-fpm-user=nginx --with-fpm-group=nginx --with-curl --with-gettext --with-kerberos --with-libdir=lib64 --with-mysqli --with-openssl --with-external-pcre --with-pdo-mysql --with-pdo-sqlite --with-pear  --with-xsl --with-zlib --with-bz2 --with-mhash --with-ldap-sasl --enable-bcmath --with-libxml --enable-mbregex --enable-mbstring --enable-exif --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-sysvshm --enable-xml --with-zip --enable-fpm --enable-gd --enable-pdo --enable-intl --enable-calendar --enable-static --enable-mysqlnd --with-jpeg=/usr/local/lib/jpeg --with-freetype=/usr/local/lib/freetype PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig/

https://blog.vini123.com/681

https://blog.vini123.com/378

https://blog.vini123.com/303

处理错误

configure: error: Package requirements (oniguruma) were not met:

那就安装: https://blog.vini123.com/379

error: Package requirements (libzip >= 0.11 libzip != 1.3.1 libzip != 1.7.0) were not met:

php8 对 libzip有要求。编译安装 libzip 就可以。博客内已有说明。

致命错误:已杀死 signal terminated program cc1

阿里云安装程序时,出现这个是服务器内存太小。通过增加服务器的swap大小来处理。

解决方法

先重新配置 php,在编译时增加一项 --disable-fileinfo 。记住,这个很重要。

#获取要增加的2G的SWAP文件块
dd if=/dev/zero of=/swapfile bs=1k count=2048000
#创建SWAP文件
mkswap /swapfile 
#激活SWAP文件
swapon /swapfile   
#查看SWAP信息是否正确
swapon -s  
#添加到fstab文件中让系统引导时自动启动
echo "/var/swapfile swap swap defaults 0 0" >> /etc/fstab

删除交换区

swapfile文件的路径在/var/下,编译完后, 如果不想要交换分区了, 可以删除。

swapoff /swapfile
rm -rf /swapfile

参考

https://www.cnblogs.com/huojing/articles/15824136.html
https://www.jianshu.com/p/a4ad05a51456

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注