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"

相关推荐
catchadmin10 小时前
用 Laravel 官方 AI 工具提升开发效率 效率提示数倍
人工智能·php·laravel
小白勇闯网安圈12 小时前
file_include、easyphp、ics-05
网络安全·php·web
好大哥呀12 小时前
PhpStorm 2025.1 PHP 专业开发下载安装中文设置步骤
php
27399202913 小时前
qt 获取IP地址(公网 本机)
qt·tcp/ip·php
互亿无线明明14 小时前
国际短信通知服务:如何为全球业务构建稳定的跨国消息触达体系?
java·c语言·python·php·objective-c·ruby·composer
阿海57415 小时前
安装nginx1.29.3的shell脚本命令
linux·nginx
柯南二号16 小时前
【后端】【Java】可直接落地的 Nginx + Java(Spring Boot)+ Redis 的短链系统实现
java·spring boot·nginx
Q_Q51100828516 小时前
python+springboot+django/flask基于深度学习的音乐推荐系统
spring boot·python·django·flask·node.js·php
Q_Q51100828516 小时前
python+springboot+django/flask基于深度学习的淘宝用户购物可视化与行为预测系统
spring boot·python·django·flask·node.js·php
古城小栈17 小时前
Go实现的区块链 分片技术优化
golang·区块链·php