kylin v10 php源码安装后配置nginx

银河麒麟V10 源码编译安装php7.4

下载地址 https://www.php.net/distributions/php-7.4.33.tar.xz

安装依赖包,准备编译

bash 复制代码
dnf install libxml2-devel sqlite-devel bzip2-devel libcurl-devel libjpeg-turbo-devel freetype-devel openldap-devel libtool-devel pcre2-devel nettle-devel libzip gmp-devel oniguruma-devel readline-devel net-snmp-devel libxslt-devel libssh2-devel libevent-devel python3-mysqlclient
tar xf php-7.4.33.tar.xz
cd php-7.4.33
./configure --prefix=/usr --with-curl --with-freetype --enable-gd --with-jpeg --with-gettext --with-gmp --with-mysqli --with-openssl --with-pdo-mysql --with-xmlrpc --with-xsl --with-mhash --enable-fpm --enable-bcmath --enable-mbstring --enable-sockets --enable-xml --enable-embed --enable-phpdbg --with-ldap --with-snmp --with-bz2 --enable-calendar --with-curl --enable-exif --enable-ftp --enable-pcntl --with-zlib --with-readline --enable-shmop --enable-sockets
ln -s /usr/lib64/libldap.so /usr/lib
ln -s /usr/lib64/liblber.so /usr/lib
make && make install

安装完php修改nginx配置

解开注释,将/scripts改为$document_root

bash 复制代码
fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name
fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name
bash 复制代码
location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }

上面配置不做修改就会报 File not found.

通过查看nginx报错日志发现包含这样的错误FastCGI sent in stderr: "Primary script unknown"

相关推荐
微爱帮监所写信寄信4 小时前
微爱帮监狱寄信写信工具照片高清处理技术架构
开发语言·人工智能·网络协议·微信·php
眠りたいです5 小时前
docker-compose:使用docker-compose对多容器应用进行管理并进行wordpress简单站点的搭建
运维·nginx·docker·容器·wordpress·busybox
天下皆白_唯我独黑6 小时前
php -S 启动项目访问路由报错处理
开发语言·php
梅羽落7 小时前
python武器化开发_01
开发语言·python·php
兮动人7 小时前
Fatal error: Uncaught think\exception\ErrorException: SourceGuardian Loade
android·php
阿干tkl8 小时前
基于nginx服务文件上传及下载
运维·nginx
oMcLin8 小时前
Ubuntu 24.04 使用 systemd 时 Nginx 服务无法启动的原因分析与解决
linux·nginx·ubuntu
catchadmin8 小时前
2026 年 PHP 开发者进阶 快速高效开发学习习惯
学习·php
oMcLin8 小时前
Ubuntu 22.04 配置 Apache 反向代理时无法访问后端应用:Nginx 与 Apache 配置冲突排查
nginx·ubuntu·apache