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"

相关推荐
遇见火星1 小时前
Linux 网络性能测试实战:用 iperf3 精准测出真实带宽与丢包率
linux·网络·php·iperf3
lwhdjbcjdjd3 小时前
Nginx与Tomcat协作处理流程及数据流向
运维·nginx·tomcat
DKunYu4 小时前
5.网络原理之TCP_IP
网络·tcp/ip·php
ooooooctober5 小时前
PHP代码审计框架性思维的建立
android·开发语言·php
Q_Q5110082855 小时前
python+django/flask的宠物用品系统vue
spring boot·python·django·flask·node.js·php
大大水瓶6 小时前
Nginx学习
学习·nginx·dubbo
百***25616 小时前
Nginx作用以及应用场景
运维·nginx
小徐敲java7 小时前
window使用phpStudy在nginx部署前端测试
运维·前端·nginx
Crazy________7 小时前
38nginx四层负载均衡配置,和动静分离解析
linux·运维·nginx·负载均衡
百***35948 小时前
如何在树莓派部署Nginx并实现无公网ip远程访问内网制作的web网站
前端·tcp/ip·nginx