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"

相关推荐
Avan_菜菜6 天前
FRP 内网穿透完整实战:从 HTTP 映射到 HTTPS 自签代理
运维·nginx·https
两个人的幸福8 天前
Windows 桌面应用自研 PHP 队列(下):完整代码与六大工程化优化
php
ping某10 天前
为什么 Nginx 明明监听了 80,转发后端时却用了 4xxxx 端口?
后端·nginx
BingoGo10 天前
PHP 泛型之殇 泛型 RFC 提案被拒绝
后端·php
JaguarJack10 天前
PHP 泛型之殇 泛型 RFC 提案被拒绝
后端·php
用户30745969820711 天前
PHP 扩展——从入门到理解
php
鹏仔先生12 天前
拷贝漫画APP下载页PHP程序,后台带免费AI写作
php
云水一下12 天前
从零开始学 PHP 系列(一):PHP 的前世今生与开发环境搭建
开发语言·php
xingpanvip12 天前
星盘接口开发文档:本命盘接口指南
android·开发语言·css·php·lua
難釋懷12 天前
Nginx反向代理中的容错机制
运维·nginx